Skip to content

feat(run): record the model's call id on each tool call - #73

Merged
juicycleff merged 1 commit into
mainfrom
feat/record-tool-call-ids
Nov 18, 2026
Merged

juicycleff merged 1 commit into
mainfrom
feat/record-tool-call-ids

Conversation

@juicycleff

Copy link
Copy Markdown
Contributor

What this does

Records the model's id for each tool call on its tool call row, so a host can pair a recorded call with the approval decision that named it, exactly.

  • run.MetadataCallID = "call_id": the metadata key, documented as the id the tool result and an approval decision name the call by (not unique across a run; a later response may reuse it).
  • Set on every row the engine records: the react loop (sync and streaming), reclaim replay, and resume. On resume the amended-arguments markers (arguments_amended, amended_by) are merged into the same map instead of replacing it.
  • No id, no key: a call without an id leaves Metadata nil.
  • A run that requires verification keeps the id private like other generated text (publicGenerationText), so its rows carry no call_id; the existing transcript privacy tests stay green.

foundry's agent step bridge already reads this key (xraph/foundry#59), so its run trace pairs calls with tool approvals by id once foundry requires a cortex release with this change.

Tests

New tests for a straight run (sync and streaming), approve, reject, amend (markers kept), reclaim replay and an empty id. go test ./... passes in the root module, including the sqlite, postgres and mongo store suites; golangci-lint v2.12.2 (Go 1.26) reports 0 issues; go mod tidy changes nothing.

@codecov

codecov Bot commented Nov 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.61538% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
engine/resume.go 60.00% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@juicycleff
juicycleff merged commit 6e0190d into main Nov 18, 2026
25 checks passed
@juicycleff
juicycleff deleted the feat/record-tool-call-ids branch November 18, 2026 20:27
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