Skip to content

docs+fix: README toolCallId pairing; catch SIGTERM as documented - #6

Merged
Cro22 merged 1 commit into
masterfrom
fix/pairing-doc-and-sigterm
Aug 9, 2026
Merged

docs+fix: README toolCallId pairing; catch SIGTERM as documented#6
Cro22 merged 1 commit into
masterfrom
fix/pairing-doc-and-sigterm

Conversation

@Cro22

@Cro22 Cro22 commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Addresses the review on tool-call pairing alignment and the signal-precision nit.

Pairing alignment (review point 1)

Audited all five surfaces. The evaluator, tests, schema, and trace-schema doc were already aligned on toolCallId being authoritative:

  • evaluator/toolcalls.go matchPending: id match is authoritative (a result whose id matches no pending call is an orphan, no name fallback); name/FIFO is used only when the result carries no id.
  • evaluator/toolcalls_test.go: PairsByIDOutOfOrder, ResultWithUnknownIDIsOrphan, IDMatchWinsOverName cover exactly this.
  • trajectory/trace.schema.json: toolCallId is "Authoritative for pairing when present, in which case no name/order fallback is used"; tool is the "Fallback pairing key when toolCallId is absent."
  • docs/trace-schema.md: "Preferred key is toolCallId ... authoritative ... Fallback (no id): tool name, FIFO."

The README was the only stale surface, describing the fallback as if it were the primary mechanism. Fixed to lead with toolCallId (authoritative, order-independent) and name/FIFO as fallback.

SIGTERM (review point 4)

main registered only os.Interrupt while its comment said "SIGINT or SIGTERM". Added syscall.SIGTERM so a SIGTERM (the default kill / orchestrator stop on Unix) actually cancels an in-flight run, notably the network-bound LLM judge. Comment and behavior now match.

Verification

go build ./... && go vet ./... && go test ./... green.

Not included (deliberately)

  • Strict unknown-field rejection at load (review point 2): left as-is. Making DisallowUnknownFields the default would break the additive/forward-compatible contract the schema promises (0.x minors add optional fields). If desired, better as an opt-in -strict flag than a default; happy to add it separately.
  • Centralized CLI error handling / log.Fatalf polish (review point 5): noted as a future polish pass, not urgent.

🤖 Generated with Claude Code

The tool_calls evaluator already pairs by toolCallId authoritatively (with a
name/FIFO fallback only when a result has no id), matching the schema, the trace
docs, and the id-pairing tests. Only the README still described the fallback as
the primary mechanism ("by tool name, in order"); update it to lead with the id.

Also, main registered only os.Interrupt while its comment claimed "SIGINT or
SIGTERM". Register syscall.SIGTERM too so the comment is accurate and a SIGTERM
(the default kill/orchestrator stop signal on Unix) actually cancels an in-flight
run, notably the network-bound LLM judge.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Cro22
Cro22 merged commit ca07db3 into master Aug 9, 2026
6 checks passed
@Cro22
Cro22 deleted the fix/pairing-doc-and-sigterm branch August 9, 2026 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant