Skip to content

berd law and fixes for subagent activity - #17

Merged
loganj merged 9 commits into
mainfrom
larry/subagent-activity-laws
Aug 13, 2026
Merged

berd law and fixes for subagent activity#17
loganj merged 9 commits into
mainfrom
larry/subagent-activity-laws

Conversation

@loganj

@loganj loganj commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

🤖

Summary

This PR changes the rendered chat UX, not just the written laws. Of its 990 added lines, 5 codify the two laws in LAWS/CHAT.md; the other 985 implement and test the behavior across ACP provenance persistence, activity classification, rendering, transcript cache invalidation, and localization.

Subagent activity now names the agent and delegated task whenever Berd knows them, and uses operation-specific titles for message delivery, waiting, interruption, and cancellation.

UX problem

Subagent tool calls often appeared as generic or misleading activity in chat. Berd could know which subagent was involved and what work it was doing, but lose that context between the original delegation and later wait/check/cancel events. Users then saw titles such as “Waiting on a subagent” instead of the agent and task they were actually waiting for.

Codex collaboration actions also shared labels that overstated what happened: delivering a message appeared as a new delegation, interrupting the current turn appeared to cancel the agent, and waits involving several agents hid all target names.

Rendered behavior

Situation Before After
Waiting for known delegated work Waiting on a subagent Waiting on Rivet · Count markdown files
Message to an existing agent Delegating to /root/reviewer · Review the patch Sending a message to /root/reviewer · Review the patch
Interrupting reusable agent work Cancelling /root/reviewer Interrupting /root/reviewer’s current turn
Waiting for multiple known agents Waiting on a subagent Waiting on agent-1, agent-2

The implementation:

  • preserves agent identity and delegated-task provenance as separate facts on tool requests;
  • recovers Goose async provenance from the original delegation for later await/check/cancel activity;
  • handles Codex collaboration lifecycle payloads, including identity that arrives late in live sessions or transcript replay;
  • classifies and renders delegation, message delivery, waiting, interruption, and cancellation distinctly;
  • renders every valid target for plural waits;
  • invalidates affected virtual transcript rows when late provenance changes their visible titles; and
  • keeps malformed or ambiguous payloads generic rather than inventing attribution.

These paths cover Goose, Claude Code, and the Codex collaboration lifecycle. English and Spanish catalogs include the new activity copy.

Laws added

  1. Subagent activity MUST attribute the subagent when its identity is known.
  2. Subagent activity MUST describe the delegated task when it is known.

Violations fixed

  • Lost Goose provenance: await/check/cancel calls showed only generic activity or a task ID even when the original delegation identified the agent and task. They now recover and render both facts.
  • Collapsed identity and task: one overloaded label could not preserve both facts. Tool requests now store agent identity, task label, and configured-task provenance separately.
  • Missing Codex lifecycle attribution: spawn, follow-up, message, wait, interrupt, and close payloads were not consistently classified or attributed, including late identity during live updates and replay. They now are.
  • Misstated operations: send_message appeared as delegation and interrupt_agent appeared as cancellation. They now render message delivery and current-turn interruption respectively; actual close remains cancellation.
  • Incomplete plural waits: waits targeting several known agents hid their identities. They now show every valid target.
  • Stale visible titles: late provenance could update stored data without refreshing a virtualized transcript row. Provenance is now part of row revision keys.
  • Fabricated task descriptions: Goose task IDs could be shortened and displayed as though they described the work. They remain correlation identifiers; unknown facts stay generic.

Scope

  • Keeps inventory-only operations such as Codex list_agents out of subagent activity.
  • Includes matching English and Spanish activity copy.
  • Follow-up to #1116; no migration or rollout step is required.

@loganj
loganj requested a review from a team August 13, 2026 14:23
Larry added 6 commits August 13, 2026 10:23
Signed-off-by: Larry <8cf5a83f590ec0955b11647d1c88f796a98e088c30a492c58e0e46c3026ae7a4@buzz.block.builderlab.xyz>
Signed-off-by: Larry <8cf5a83f590ec0955b11647d1c88f796a98e088c30a492c58e0e46c3026ae7a4@buzz.block.builderlab.xyz>
Signed-off-by: Larry <8cf5a83f590ec0955b11647d1c88f796a98e088c30a492c58e0e46c3026ae7a4@buzz.block.builderlab.xyz>
Signed-off-by: Larry <8cf5a83f590ec0955b11647d1c88f796a98e088c30a492c58e0e46c3026ae7a4@buzz.block.builderlab.xyz>
Signed-off-by: Larry <8cf5a83f590ec0955b11647d1c88f796a98e088c30a492c58e0e46c3026ae7a4@buzz.block.builderlab.xyz>
Signed-off-by: Larry <8cf5a83f590ec0955b11647d1c88f796a98e088c30a492c58e0e46c3026ae7a4@buzz.block.builderlab.xyz>
@loganj
loganj force-pushed the larry/subagent-activity-laws branch from 564ddcc to 245778f Compare August 13, 2026 14:24

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 564ddcc557

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread LAWS/CHAT.md
Signed-off-by: Larry <8cf5a83f590ec0955b11647d1c88f796a98e088c30a492c58e0e46c3026ae7a4@buzz.block.builderlab.xyz>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f5ed095e88

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/features/chat/lib/subagentToolCalls.ts Outdated

@kalvinnchau kalvinnchau left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review at f5ed095e, including the independent review from peon. The remaining behavioral finding is the existing inline P2 on unclassified Codex lifecycle calls, which I independently verified against Codex's current followup_task(target, message) and interrupt_agent(target) schemas. One non-blocking maintainability finding is inline below. The previously reported spawn_agent provenance defect is fixed at this head.

Validation at this exact head: pnpm check and pnpm typecheck pass; focused provenance/projection/UI/ACP suites pass 176/176; AppShell.navigation.test.tsx passes 130/130 in isolation. The full frontend run had one unrelated AppShell focus assertion fail while 6,131 tests passed; the isolated rerun passed. Rust, security, clean-install, and DCO CI checks are green; frontend CI is still pending.

Comment thread src/features/chat/lib/subagentToolCalls.ts Outdated
@kalvinnchau kalvinnchau changed the title Preserve subagent identity and task provenance fix: preserve subagent identity and task provenance Aug 13, 2026
Signed-off-by: Larry <8cf5a83f590ec0955b11647d1c88f796a98e088c30a492c58e0e46c3026ae7a4@buzz.block.builderlab.xyz>
@loganj
loganj force-pushed the larry/subagent-activity-laws branch from 6758f43 to 4e77de3 Compare August 13, 2026 16:25

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4e77de3d1c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/features/chat/lib/subagentToolCalls.ts Outdated
Comment thread src/features/chat/lib/subagentToolCalls.ts Outdated
Comment thread src/features/chat/lib/subagentToolCalls.ts Outdated
Signed-off-by: Larry <8cf5a83f590ec0955b11647d1c88f796a98e088c30a492c58e0e46c3026ae7a4@buzz.block.builderlab.xyz>
@loganj loganj changed the title fix: preserve subagent identity and task provenance more berd law and fixes for subagent activity Aug 13, 2026
@loganj loganj changed the title more berd law and fixes for subagent activity berd law and fixes for subagent activity Aug 13, 2026
@loganj
loganj merged commit a3b6e90 into main Aug 13, 2026
15 of 16 checks passed
@loganj
loganj deleted the larry/subagent-activity-laws branch August 13, 2026 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants