feat(turns): extract turns from agent-tokens artifact in workflow_run_id mode#20
Conversation
|
Findings:
Overall the implementation is solid, but those two paths can fail in production in ways that either lose a run or spam duplicate comments. |
|
Findings:
|
The code changes in |
…f only" This reverts commit dec1e33.
Summary
turnsfield toAgentTokensArtifacttypeparseAgentTokensZipnow passesturnsthrough when present in the artifact JSONfetchAgentTokensreturnsartifactTurns: number | nullalongsidetokensWorkflowRunDatanow carriesartifactTurnsrun.tsresolution priority: explicitturnsinput →artifactTurns(artifact) →extractTurnsFromOutput(agent_output)Why turns were never populated for CI runs
The action already had
extractTurnsFromOutputwired, but theworkflow_run_idpath fetches tokens from theagent-tokensartifact rather than processingagent_outputdirectly. The artifact format didn't include turns, so they were always null.How to wire turns in an agent workflow
In the workflow that produces the artifact, add
turnstoagent-tokens.json:The field is optional — existing workflows that don't include it will continue to work with
artifactTurns: null.Test plan
artifactTurnsto null when absent