Uh oh!
There was an error while loading. Please reload this page.
fix(cli): attribute step events to their model in run json output - #44462
fix(cli): attribute step events to their model in run json output#44462Enough1122 wants to merge 1 commit into
Conversation
opencode run --format json emitted step_start/step_finish without any model reference, so headless consumers could not attribute tokens or cost across model switches or subagents. The core session.step.started event already carries the model; capture it and stamp providerID/modelID onto both JSON parts, clearing it when the step ends. Fixesanomalyco#40544
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
The following comment was made by an LLM, it may be inaccurate: Potential Duplicate FoundPR #40545: fix(opencode): add model attribution to run --format json events This PR appears to be directly related to the current PR #44462. Both are focused on adding model attribution (providerID/modelID) to Since the current PR (#44462) closes issue #40544 and is also about attributing step events to their model in JSON output, you should verify whether #40545 already addresses this or if they're complementary changes to different aspects of the same feature. |
Enough1122
commented
Aug 23, 2026
Heads up that #40545 ( |
Enough1122
commented
Aug 23, 2026
Similar work landed in #40545 against |
Issue for this PR
Closes#40544
Type of change
What does this PR do?
opencode run --format jsonemitted step_start/step_finish without any model reference, so a headless consumer could not attribute tokens or cost - especially across mid-session model switches or subagents running a different model. The core session.step.started event already carries the model (the human output prints it), so the JSON path now stamps providerID/modelID onto step_start from the event and onto step_finish from the in-flight capture, clearing it when the step ends.How did you verify your code works?
Screenshots / recordings
Not a UI change.
Checklist