Repository navigation
[feat] agent: persist Agent turn and tool-call lineage for generation Jobs - #374
Merged
Merged
Conversation
… Jobs Job gains optional agentRunId and agentCallId, written together when an Agent generation.submit creates the job, so a job can be traced to its turn and call from committed project data without the Agent trace. Command fields and fingerprints are unchanged; jobs without an origin serialize as before.
GET .../assistant/turns/{turn_id}/jobs reads the project snapshot only and
returns the Jobs whose agentRunId matches, ordered by creation time. It never
reads the Agent trace and never starts, resumes or replays a command.
FayeSpica
reviewed
Nov 16, 2026
FayeSpica
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for making Agent-submitted jobs traceable across restarts—please fix the CI formatting failure so the remaining checks can run.
Fetch /assistant/turns/{turn}/jobs on the Trace page and list status, result and
error per Job. Also remove the extra blank line at EOF of agent/tools.py that
failed the end-of-file pre-commit hook.
8 tasks
FayeSpica
approved these changes
Nov 19, 2026
FayeSpica
left a comment
Collaborator
There was a problem hiding this comment.
Tested manually. LGTM!
As a follow-up, could we show all turns in a conversation on one trace page, like DSH does?
This was referenced Nov 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
agentRunIdandagentCallIdfields. Both are set together and omitted when unset, preserving existing non-Agent Job serialization.uuid5(run_id, call_id)Command ID derivation without changing Command payloads, fingerprints, idempotency or recovery decisions.GET /api/creation/projects/{project_id}/assistant/turns/{turn_id}/jobsto list Jobs submitted by a turn from committed project state. It does not read Agent traces, replay commands, acquire an editing lease, or invoke a provider.Linked issue
Fixes #372
Refs #261, #107
Fixes #NorRefs #Nis included, or no issue appliesLabels
Requested:
type:feat,area:agent.Test plan
tests/test_agent_job_lineage.py: 12 passed using provider doubles. Mutation check: 9 of 12 fail when the production-origin write is removed. Tests cover trace deletion, multiple Jobs, terminal failures, commit-journal crash recovery, restart without duplicate submission, legacy records, and read-only querying.scripts/generate_contracts.py --checkpassed;lint-importspassed (4 contracts, 0 broken);git diff --checkpassed.4c6c6a56): 6 new frontend pure-function tests; TypeScript check (tsc --noEmit),npm run build,npm run check:i18n, and browser verification were reported as passing.npm test: 824 passed, 2 failed; the same two tests also fail without this change.npm ci --ignore-scriptswas used because the install scripts failed in the local environment.pre-commit(hook repo could not be cloned), live provider tests, and a complete FFmpeg-enabled suite. CI was waiting for maintainer approval at last report.Evidence that it works
English, Agent Trace with linked completed and failed Jobs
简体中文,助手轨迹及关联任务状态
Provider verification
Bilingual UI
Design and compatibility notes
generation.submit; Job checkpoint, cancellation and result publication preserve the fields.job.cancel,job.recover, HTTP Command payloads and non-Agent Jobs do not introduce an origin.storage_unavailablebecause their Job model rejects unknown fields. The repository currently has no general project downgrade mechanism. Please confirm that this format-upgrade behavior is acceptable; users should back up project data before attempting to open it with an older build.