Repository navigation
feat(tier3): rebuild ATIF from OpenCode and Codex agent logs - #119
Conversation
Parse OpenCode JSON stream events into synthetic trajectories when trajectory.json is empty, and reuse the parser for structured Codex tee logs. Fail closed on non-dict tool inputs. Fixes NVIDIA#118 Signed-off-by: mimran-khan <[email protected]>
Codex tee logs use type=item / agent_message events, not OpenCode tool_use. Add a dedicated parser with stderr-tolerant JSONL scanning, keep OpenCode-shaped JSONL as a fallback, and normalize shell calls to bash for skill checks. Signed-off-by: mimran-khan <[email protected]>
|
Codex parser fixes are pushed from the earlier round. Ready for re-review when you have time. |
rng1995
left a comment
There was a problem hiding this comment.
The current head still does not reconstruct real Codex exec events, and the new OpenCode fallback is not connected to the collected-results discovery path. Focused converter and refinement tests passed (95 tests), with Ruff and diff checks clean. Requesting changes for the two reproducible integration gaps noted in the review threads.
…ries Merge main and handle Codex exec JSON item.completed events with agent_message text and command_execution items. Include opencode in trajectory discovery so refinement can rebuild ATIF from opencode.txt when trajectory.json is missing.
Signed-off-by: mimran-khan <[email protected]>
Resolve trial case ids from reward/result metadata before refine lookup. Parse Codex file_change and mcp_tool_call events, and keep OpenCode tool failures in observations via state.error. Signed-off-by: mimran-khan <[email protected]>
Signed-off-by: mimran-khan <[email protected]>
rng1995
left a comment
There was a problem hiding this comment.
Three earlier integration issues are fixed and their threads are resolved. The focused converter/refinement suite passes (36 tests), with Ruff and diff checks clean. Two correctness gaps remain: Codex terminal status, exit code, and some error forms are discarded, and OpenCode failures that include partial output lose both failed status and error details. These make failed actions indistinguishable from successful empty or partial-output actions in downstream evidence, so I am requesting changes on the two remaining threads.
Preserve exit code, status, and error evidence for failed command runs, file changes, and MCP calls, and keep OpenCode error text alongside partial output for downstream grading. Signed-off-by: mimran-khan <[email protected]>
Keep Harbor trial discovery tests from main and restore OpenCode trajectory fixtures from this branch. Signed-off-by: mimran-khan <[email protected]>
|
Pushed b4644da with main merged in. Codex command_execution now keeps status, exit_code, and errors even when command is false or output is empty; file_change and MCP calls get the same terminal evidence, and OpenCode keeps status plus error text alongside partial output. Harbor trial discovery tests from main are in, plus the OpenCode trajectory fixtures on this branch. Happy to re-test anything specific. |
|
@mimran-khan, two code blockers remain at
Please address both items and ping me when the PR is ready for re-review. |
Merge main, prefer task_id.path for Harbor entry ids, recognize Codex terminal status in error recovery, and synthesize web_search thread items. Signed-off-by: mimran-khan <[email protected]>
|
@chrisknvidia follow-up on todays three threads: |
|
@mimran-khan Let us know when you have addressed the final round of review comments present in PR. Post that, I can help merge the changes. Thanks for your contributions! |
Missed the last update for some reason, let me take a look. @rng1995 : thanks for the nudge |
Merge main and synthesize WebSearchItem action payloads plus collab_tool_call thread items into ATIF with schema-shaped fixtures. Signed-off-by: mimran-khan <[email protected]>
rng1995
left a comment
There was a problem hiding this comment.
@mimran-khan — Re-reviewed current head 8063d5b. The earlier Codex/OpenCode integration, Harbor case-id, terminal-evidence, bounded-output, and downstream error-recovery findings are fixed; their verified threads are resolved. Local verification is otherwise clean: changed-file Ruff passes, focused converter/refinement tests are 53/53, the broader Tier 3 suite is 1,235 passed, and git diff --check is clean. Two schema correctness blockers remain in the existing unresolved threads: (1) schema-valid multi-query web_search events lose the action type and queries from ATIF arguments, while the new fixtures omit required wire fields and add non-wire status; (2) schema-valid collab_tool_call events lose sender_thread_id, receiver_thread_ids, and agents_states, and the new fixture does not exercise them. These can silently remove source-retrieval and delegated-agent evidence, so I am requesting changes. The newest fork workflows also remain at the separate action_required authorization gate.
|
@mimran-khan - Can you address the remaining review comments presented here: #119 (review) so that we can merge the MR? |
Signed-off-by: mimran-khan <[email protected]>
Keep the full WebSearchItem action payload (including multi-query searches) and map CollabToolCallItem sender/receivers/agents_states with schema-valid fixtures. Signed-off-by: mimran-khan <[email protected]>
|
@rng1995 addressed the remaining schema blockers from #119 (review) at |
Emit metadata.exit as exit_code= in OpenCode observations and treat any nonzero exit as a failure in both error-recovery checkers. Signed-off-by: mimran-khan <[email protected]>
Resolve CHANGELOG conflict after NVIDIA#100 landed on main. Signed-off-by: mimran-khan <[email protected]>
Resolve the CHANGELOG conflict after the 0.4.0 release on main: main moved the `--no-llm` entry out of 0.3.0 into 0.4.0, so drop it from 0.3.0. Move this branch's unreleased entries (log converters, Harbor result.json case ids, Codex log synthesis) from the released 0.3.0 section into the new Unreleased section. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Narendran Raghavan <[email protected]>
rng1995
left a comment
There was a problem hiding this comment.
@mimran-khan Thank you for your patience through a long review, and for your contribution to SkillEvaluator!
I re-reviewed 4194d8a against the upstream Codex exec_events.rs schema. All three remaining threads are fixed:
- Codex
web_search:action_inputkeeps the required top-levelqueryand the fullactionobject. Multi-querysearchkeepstypeandqueries,open_pagekeepsurl, andfind_in_pagekeepsurlandpattern. The fixtures now use the real event shape. - Codex
collab_tool_call:tool,sender_thread_id,receiver_thread_ids,prompt,agents_statesandstatusall reach ATIF, and the fixture checks every field. - OpenCode exit codes: a
completedbash call with a nonzerometadata.exitkeepsexit_code=Nin the observation. Both error-recovery checkers (eval_core and the Harbor template) now treat it as a failure, so a failed command followed by a retry no longer scores as "All commands succeeded on first attempt".
Each new regression test fails on the code from before its fix and passes at head. Ruff passes, the full suite passes (9,538 passed, 18 skipped), and all 17 CI checks are green.
Before this can merge, the CHANGELOG.md conflict with main needs resolving. main released 0.4.0, so this PR's entries belong under ## Unreleased. That is the only conflict, and the code merges cleanly.
Non-blocking follow-ups for a later PR:
exit_code=-1doesn't match the nonzero-exit pattern, so a failure with that code still counts as a clean first attempt.- Upstream Codex now emits
WebSearchItem.results, and the converter reads onlyresult.
Approved.
Resolve the collector.py conflict with NVIDIA#119, which made Harbor result.json case ids prefer the canonical task_id.path directory over repository-prefixed task_name values. Keep this branch's _resolve_harbor_result_entry_id (metadata.entry_id from the task path, staged-name map, arm-suffix handling) and apply NVIDIA#119's rule inside it: when the result carries a task path that has no metadata.entry_id or map entry, return the directory name before falling back to task_name. This also keeps a valid dual-arm set with directory y (with [task]) next to y-with-skill (no [task]) from being collected under y. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Narendran Raghavan <[email protected]>
* feat(tier3): rebuild ATIF from OpenCode and Codex agent logs Parse OpenCode JSON stream events into synthetic trajectories when trajectory.json is empty, and reuse the parser for structured Codex tee logs. Fail closed on non-dict tool inputs. Fixes #118 Signed-off-by: mimran-khan <[email protected]> * fix(tier3): parse Codex exec --json JSONL for ATIF fallback Codex tee logs use type=item / agent_message events, not OpenCode tool_use. Add a dedicated parser with stderr-tolerant JSONL scanning, keep OpenCode-shaped JSONL as a fallback, and normalize shell calls to bash for skill checks. Signed-off-by: mimran-khan <[email protected]> * fix(tier3): address OpenCode/Codex ATIF and Harbor trial id gaps Resolve trial case ids from reward/result metadata before refine lookup. Parse Codex file_change and mcp_tool_call events, and keep OpenCode tool failures in observations via state.error. Signed-off-by: mimran-khan <[email protected]> * fix(tier3): retain terminal status in Codex and OpenCode logs Preserve exit code, status, and error evidence for failed command runs, file changes, and MCP calls, and keep OpenCode error text alongside partial output for downstream grading. Signed-off-by: mimran-khan <[email protected]> * fix(tier3): preserve terminal evidence in bounded observations Attach file-change status to every write call, and trim long tool output without dropping status or error text. Signed-off-by: mimran-khan <[email protected]> * fix(tier3): preserve Codex web_search and collab wire fields Keep the full WebSearchItem action payload (including multi-query searches) and map CollabToolCallItem sender/receivers/agents_states with schema-valid fixtures. Signed-off-by: mimran-khan <[email protected]> * fix(tier3): preserve OpenCode bash exit codes for error recovery Emit metadata.exit as exit_code= in OpenCode observations and treat any nonzero exit as a failure in both error-recovery checkers. Signed-off-by: mimran-khan <[email protected]> --------- Signed-off-by: mimran-khan <[email protected]> Signed-off-by: Narendran Raghavan <[email protected]> Co-authored-by: Christopher Kevin <[email protected]> Co-authored-by: Narendran Raghavan <[email protected]> Co-authored-by: Narendran Raghavan <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
Fixes #118
When Harbor leaves
trajectory.jsonempty, Tier 3 scoring used to fail with "No trajectory or reconstructible agent log" even though OpenCode and Codex tee structured JSON toopencode.txtandcodex.txt.This adds parsers for OpenCode
run --format=jsonevents (text + completedtool_userecords) and wires them intoload_trajectory_with_fallbackafter the existing claude/cursor/cline fallbacks. Codex reuses the same parser when every tee line is JSON. Non-dict tool inputs are ignored so raw strings are not treated as shell commands.Harbor task bundles already copy
log_converters.pythroughadapter.py, so generated verifiers pick this up automatically.Distinct from #110, which is about exec steps inside an existing trajectory.
Test plan
pytest tests/tier3/test_log_converters.pypytest tests/test_harbor_collector_runtime_failures.py