Repository navigation
feat(agents): Read child agent state without an Agent invocation row - #3226
Conversation
Step 6a of #3060. Rows are still written. Every reader now works when a child has no Agent invocation row: a parent task runs on the root Turn code as the parent Turn's Actor with its grants, status comes from the child's Turns and mailbox, reply ids can name the child Conversation, and spawn options live on the child Conversation. Co-Authored-By: David Cramer <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Verify that a parent message names the child's stored parent, and drop and log it otherwise. Route it to an open Agent invocation first. Label it as the instruction for Guardian, and accept an ancestor's timer grant only on a checked parent message. Count children without a row in open child work, the per-child queue limit, the stopped check, archive, and dashboard labels. Rename agent.task to agent.parent_message and spell out Agent invocation in names. Refs #3060 Co-Authored-By: David Cramer <[email protected]>
Count only replies from children without a row as open child work, and report a parent's replaced result only after a completed Turn of a child without a row. Log a dropped parent message once, where the child drops it. Refs #3060 Co-Authored-By: David Cramer <[email protected]>
|
spawn options would be shared through all kinds right? like agents should have one shared set of typed configuration, and while that might vary by kind, shouldnt need their own special cased columns/etc |
Resolve conflicts in list.ts (batched Conversation loop check), conversation-turn.ts (instruction Actor), and the migration journal. Regenerate the child column as migration 0105 and name it as a shared agent config: agent_config_json, typed as AgentConfig for every kind.
|
Yes. In 612251c the column is now |
|
17 screenshot changes — 17 changed · 0 added · 0 removed Review screenshots in Frameshift Show 11 more changed screenshots |
Child replies and results store their sender Conversation, Turn, and Agent invocation in input.metadata.sender. The mailbox keeps those fields next to each id, so readers no longer parse message ids. The id format is unchanged and is only an idempotency key. Messages from before this change go through one id fallback, marked for removal next release. Co-Authored-By: David Cramer <[email protected]>
Co-Authored-By: David Cramer <[email protected]>
…, and replaced results
|
im going to need to you address the PR description being.. too jargon-y. im not an expert on the underlying code here and you didnt explain what this is truly doing |
|
Rewrote the description in plain terms: why the agent invocation rows matter, why this PR changes nothing visible yet, and how each reader works for a child with no row. |
…out-rows # Conflicts: # packages/junior/migrations/meta/0105_snapshot.json # packages/junior/migrations/meta/_journal.json
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 22c61a9. Configure here.
…#3312) Follow-up to #3226, before step 6b of #3060. A child agent with an Agent invocation row can hold at most 4 open messages, because each message became its own Agent invocation run. A child with no row runs parent messages from its mailbox, like any other input, and the mailbox has no size limit. So this removes the limit for children with no row instead of counting their messages. Children with a row keep the limit until step 7 deletes rows. The limit of 8 active children per parent stays. The shared `thread-input` test harness can now save a run's input as its Turn's first checkpoint and pause at a yield, as the agent does, so tests can see open Turns. Rollback: revert this PR. Only children with no row change, and nothing creates them until 6b. <!-- junior-request-attribution:start --> via @dcramer. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent%3Abf1b82d8dc5a8d5198d56ec7f551563e --> -- [View Session](https://junior-prod.sentry.dev/conversations/agent%3Abf1b82d8dc5a8d5198d56ec7f551563e) [[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3Abf1b82d8dc5a8d5198d56ec7f551563e/?project=4510944073809921) <!-- junior-session-footer:end --> --------- Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: David Cramer <[email protected]>
Agents that trip a ratchet check add a baseline entry and the check passes. Review caught this in #3035 and #3564, and it merged in #3460, #3226, and #3206. baseline-growth:check compares each debt baseline to the merge base with origin/main and fails when a rule's total rises. Totals per rule let a file move or split without failing. Co-Authored-By: David Cramer <[email protected]>
…its check (#3612) ## Baselines can only shrink The ratchet baselines (`type-assertions`, `await-in-loop`, `test-architecture`, `typecheck-coverage`, `migration-locks`, `tool-descriptions`, `file-length-exceptions`) already say "do not add entries". But when a check trips, an agent can still add an entry and the check passes. Review caught this on #3564 and #3035, both from @BYK. It merged without review in #3460, #3226, and #3206. `pnpm baseline-growth:check` is now part of `pnpm lint`. It compares each baseline to the merge base with `origin/main` and fails when a rule's total goes up. The error names the baseline, the rule, and the entries that caused it. Totals are counted per rule, so a file that moves or splits still passes. A rule or baseline that is new in the change is skipped, because that is how a new check gets adopted. The CI lint job now uses `fetch-depth: 0` so it has a merge base. `tool-error-classification-baseline.txt` is left out because it is an allowlist of approved system errors and grows on purpose. ## Use data the system already has before you add plumbing Agents fix missing information with new hooks, resolvers, and lookups instead of using data the system already stores, as in #3610, #3404, and #3457. No check can tell a needed abstraction from a speculative one, so `policies/correctness-complexity.md` now names this case. ## Generate deterministic output in code, not prompt text Agents fix deterministic behavior with prompt or policy text. #3610 first tried to fix PR links with a GitHub system prompt change, and @dcramer rejected it: "We know if it's a pull request or an issue. We should just be generating the right link." The bot name in prompts (#3404) had to become a check, and #3438 was told not to add policy text when a rule can enforce it. `policies/agent-steering.md` now says to generate links, IDs, and formats in code. ## Rule table The AGENTS.md rules are now a table that says what enforces each rule. A correction for a rule marked "Review" shows that the rule is a repeat and needs a higher-level fix. ## Open decision - There is no override for baseline growth. If a reviewer approves a growth, they have to change the check. Should there be an approved override, such as a PR label? <!-- junior-request-attribution:start --> via @dcramer. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent%3A9da30a1e94fc26f2b83022cfd8dd95fc --> -- [View Session](https://junior-prod.sentry.dev/conversations/agent%3A9da30a1e94fc26f2b83022cfd8dd95fc) [[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3A9da30a1e94fc26f2b83022cfd8dd95fc/?project=4510944073809921) <!-- junior-session-footer:end --> --------- Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: David Cramer <[email protected]>

Step 6a of #3060.
What this is for
When an agent starts a child agent (a Task or a Thread), Junior writes a row to the
junior_agent_invocationstable. Today that row is the only record of the child's work: whether it is still running, who started it, its permissions, and whether its result went back to the parent. Many parts of the code read that row. If the row is missing, they fail or show wrong data.#3060 removes these rows so a child agent works like any other Conversation. This PR does not remove them. It only makes every reader work without a row.
What changes now
Nothing you can see. Junior still writes a row for every child, and each reader uses the row when it exists, as on
main. The new code runs only for a child that has no row, and this PR creates none.After this ships, the next PR (6b) can stop writing rows behind a flag. If 6b goes wrong, a rollback to this release is safe, because this release already reads children with and without rows.
How a child without a row is read
searchAgents,waiting_on, and the dashboard.agent_config_json, will hold the child's settings (agent type, fork, reasoning level). This PR does not write it. Stop, archive, the queue limit, and the dashboard labels read the child's Conversation instead of the row.Notes
Rollback: revert this PR. The new column is nullable and unused while rows are still written.
via @dcramer.
--
View Session [Sentry]