fix(acp): keep tool_call content, rawInput, and rawOutput in captured trajectories - #1100
fix(acp): keep tool_call content, rawInput, and rawOutput in captured trajectories#1100Benjamin-eecs wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Devin Review found 1 potential issue.
1 flag not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)
| initial_content = update.get("content") | ||
| if isinstance(initial_content, list) and initial_content: | ||
| record.content.extend(initial_content) | ||
| record.absorb_raw_io(update) |
There was a problem hiding this comment.
🟡 Completed file edits remain pending
When an opening tool_call reports a completed file edit, its status remains pending despite capturing its content. Timeout diagnostics then mark finished work incomplete.
Prompt for agents
The tool_call branch in src/benchflow/acp/session.py now captures opening content for codex-acp file-change events, but ToolCallRecord still starts as PENDING and this branch ignores update["status"]. Codex file-change notifications can be complete in this opening event without a later tool_call_update. Parse and apply a present opening status using the same unknown-status handling as the update branch, while preserving PENDING when no status is supplied. Add coverage that a completed opening-only file-change call is terminal and absent from pending_tool_call_ids().
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Good catch, fixed in 301c72f: the opening tool_call's status is applied with the same unknown-status handling as updates, PENDING stays the default when absent, and a test covers a completed opening-only edit leaving pending_tool_call_ids().
|
I tried pretty hard to break this and I’m comfortable approving it. I verified the capture path end to end with the shipped On the PR head:
I found three non-blocking follow-ups:
None of these block the fix as scoped. Approved. |
|
I encountered the same issue while running ClawsBench with Across 44 trials, all 770 Codex tool-call events were present, including IDs, titles, kinds, and statuses. However, all 770 had empty ClawsBench is not the loss boundary. BenchFlow’s native PR #1100 appears to solve the completed-call raw-capture problem described in #1099. Once merged, ClawsBench’s I agree adjacent consumers should be handled separately from this PR, but the sooner they are fixed, the better:
For ClawsBench, this means |
Description
acp/session.py:ToolCallRecordgainsraw_input/raw_output. Thetool_callbranch now keeps the opening notification'scontentand raw I/O; thetool_call_updatebranch mergesrawInput/rawOutputwhen present (later wins). Status handling is unchanged.trajectories/_capture.py:_events_to_trajectorywritesraw_input/raw_outputonly when set, so agents that never send them produce byte-identical trajectories.viewer/payload.py: a tool call without content blocks renders from its raw I/O:executeshows the command, then the formatted output with a nonzero exit code stated; other kinds show the JSON. Content blocks still win when both exist.Motivation and Context
Fixes #1099. codex-acp 1.6.0 reports a command as
rawInputon the openingtool_call, its output asrawOutputon the completing update, and file-change diffs ascontenton the openingtool_call. The capture read none of those, so every codex trajectory in the FrontierPhysics batch has empty tool calls and the viewer shows headers only.How Has This Been Tested?
tests/test_tool_call_raw_io.py(5 tests, docstrings name [BUG] ACP capture drops tool_call content, rawInput, and rawOutput; codex-acp trajectories have no commands, outputs, or patches #1099): raw fields survive on the record, opening-call content survives, trajectory keys appear only when set, raw rendering of commands/outputs/exit codes, payload fallback with content taking precedence.pytest tests/: all passed (29 skipped, playwright absent).ruff check,ruff format --check,ty check src/clean.createCommandExecutionUpdate,createCommandExecutionCompleteUpdate,createFileChangeUpdate) and a 540-rollout batch where 0 of 64 sampled tool calls carried content.Types of changes
Checklist