Commit Graph

7 Commits

Author SHA1 Message Date
Jaakko Husso
ab3048f48d
feat(core): Link delegated Agents executions and store cache tokens in columns (no-changelog)
Replace the `usageDetails` JSON column with top-level columns on
`agent_execution`:

- `cacheReadTokens` and `cacheWriteTokens` store the prompt-cache tokens
  of the `finish` usage. Both are subsets of `promptTokens`.
- `parentExecutionId` and `rootExecutionId` link a delegated run to the
  execution that delegated it and to the top of its tree. Both reference
  `agent_execution.id` with ON DELETE SET NULL and have an index.

The sub-agent runner sets the links from the parent execution id in the
parent persistence metadata. Background jobs pass it on dispatch. A
resumed child keeps the links of its first execution.

Remove the sub-agent usage roll-up. Each delegated run already records
its own execution, so the system usage route now returns each turn with
its descendants (found through `rootExecutionId`) and their sum.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 02:48:36 +03:00
Jaakko Husso
5f4179b3cc
feat(core): Store prompt-cache and sub-agent usage on Agents executions (no-changelog)
Add a nullable `usageDetails` JSON column to `agent_execution`. The
execution recorder now keeps the prompt-cache read and write tokens of the
`finish` usage, and the usage of direct sub-agents from their
`subagent-completed` chunks. The token columns and the thread counters do
not change: they still count the turn's own model calls only.

System agents get a `GET /agents/system/:agentId/chat/:threadId/usage`
route that returns the usage of each turn in a usable thread. Project
agents already return the new column with the thread detail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 02:48:36 +03:00
Danny Martini
b22b6f4909
feat(core): Add steering pair check to agent message queue (no-changelog) (#39893)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 10:48:39 +00:00
Robin Braumann
33505d7faa
feat(editor): Allow reordering queued messages in Agent Preview (#40101) 2026-10-01 15:44:14 +00:00
Robin Braumann
b09fd0dc69
feat(core): Add agent input boundaries and steering storage (no-changelog) (#39529) 2026-09-29 12:41:34 +00:00
Robin Braumann
84efbac6f1
refactor(core): Reference accepted messages from agent queue (#39778) 2026-09-29 08:39:25 +00:00
Robin Braumann
6c592bdb33
feat(core): Add the durable agent message queue foundation (#39435) 2026-09-24 12:27:30 +00:00