Skip to content

↩️ feat: Show and Withdraw Pending Subagent Guidance - #18217

Merged
danny-avila merged 1 commit into
danny-avila/child-thread-panefrom
danny-avila/child-thread-pending-steers
Nov 17, 2026
Merged

danny-avila merged 1 commit into
danny-avila/child-thread-panefrom
danny-avila/child-thread-pending-steers

Conversation

@danny-avila

Copy link
Copy Markdown
Collaborator

Summary

When the subagent panel draws a background child's thread as a conversation (#18197), guidance that has been sent to the child but not taken yet is not drawn anywhere, and neither is the control that withdraws it. The panel's durable view shows both, dimmed, after the transcript. So with #18197 alone a reader can send a steer from the panel's composer, or watch the parent agent send one, and then has no sign it is waiting and no way to take it back before the child reaches its next tool boundary. Guidance that was refused or failed disappears the same way.

This draws that guidance after the last row of the conversation, with Withdraw, and removes it from there once the child takes it and the stream places it in the reply.

Tenth in a stack, on #18197.

How it works

Main chat's message list has a slot for exactly this position, renderPendingSteers: what is waiting on the conversation's run, after the last row. FollowedThread leaves it empty by default; the subagent panel now fills it.

SubagentThreadPanel
  activity.controls                  # the task's receipts, from its durable view, plus one just submitted
  FollowedChildThread
    renderPendingSteers  ──>  SubagentControlHistory(controls, content = every part the thread shows)
                                waiting    -> the app's steer bubble, dimmed, + Withdraw
                                refused    -> the bubble + why
                                applied and already a part of the reply  -> not drawn (it is in the reply)
    Withdraw  ──>  submitControl('cancel_message', controlId)   # the panel's existing command

SubagentControlHistory is the list the durable view already renders; it is exported and reused, not copied, so the two bodies decide what counts as "already shown" with one rule: a receipt whose steer part is in the content is left out. That rule is what makes the hand-off seamless here. The durable view's receipt can still say accepted for a moment after the stream has delivered the applied steer, and the reply's part wins.

The list sits in main chat's row column (getMessageRowWidthClass), so it lines up with the turns above it.

Main chat's own PendingSteers component is not used: it reads main chat's steer chips and cancels through main chat's steer routes, and a child's guidance is a different record (a control receipt) withdrawn through the subagent control route. Sharing the slot and the bubble is the part that is the same.

Type of change

  • Feature
  • Tests / tooling / CI

Testing

Tested environments/configuration:

Chromium via Playwright, e2e/playwright.config.mock.ts and playwright.config.redis.ts, server and client built from this branch, in-memory Mongo, fake model.

Automated tests:

  • e2e/specs/mock/subagent-activity.spec.ts, new case "guidance the child has not taken yet waits after the last row and can be withdrawn": with a child held before its next tool boundary, a steer sent to it appears after everything the child has done, with one Withdraw; clicking it posts cancel_message to the control route and the button goes away; the child then finishes without that guidance in its reply. Passes on the memory lane and 4 of 4 on Redis.
  • That case was run with the change removed and the client rebuilt: it fails at "waiting guidance: expected 1, received 0", which is the gap.
  • The whole spec (6 cases) passes on the memory lane on this head.
  • packages/chat/src/components/subagents/__tests__/followed.spec.tsx (6 new): waiting guidance after the last row and its withdrawal; no receipt for guidance the reply already shows; no Withdraw while the task cannot be controlled; the reason for refused guidance; the "earlier control activity" notice; nothing added when no guidance was sent.
  • panel.spec.tsx (1 new): the panel hands the conversation the task's waiting receipts, and Withdraw sends cancel_message with the task and control ids.
  • packages/chat: npx jest src/components/subagents src/components/pane src/components/messages (746 tests), npx tsc --noEmit. npm run static-checks -- --against origin/dev.

Screenshots / recordings

Guidance waiting on a running child, in the conversation body. There is no "before" in this body: without this change nothing is drawn there.

Light Dark
Waiting guidance, light Waiting guidance, dark

Risk / compatibility

Only the followed body changes. The durable view renders the same component it did, now exported.

@danny-avila
danny-avila added this pull request to stack #18259 November 17, 2026 14:36
@danny-avila
danny-avila force-pushed the danny-avila/child-thread-pending-steers branch 2 times, most recently from 0d3708d to e9aa37a Compare November 17, 2026 15:05
@lia-by-librechat lia-by-librechat Bot changed the title ↩️ feat: Show Guidance a Followed Subagent Has Not Taken Yet, With Its Withdraw ↩️ feat: Show and Withdraw Pending Subagent Guidance Nov 17, 2026
@danny-avila

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T15:12:57.418970Z e9aa37a Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: e9aa37a3fb

ℹ️ 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".

@danny-avila
danny-avila force-pushed the danny-avila/child-thread-pending-steers branch from e9aa37a to 9a4098b Compare November 17, 2026 15:33
@danny-avila
danny-avila force-pushed the danny-avila/child-thread-pending-steers branch 3 times, most recently from 975d834 to f55bc37 Compare November 17, 2026 15:42
@danny-avila
danny-avila force-pushed the danny-avila/child-thread-pending-steers branch 2 times, most recently from 67169eb to 583281e Compare November 17, 2026 15:54
@danny-avila
danny-avila force-pushed the danny-avila/child-thread-pending-steers branch from 583281e to 348dbf1 Compare November 17, 2026 16:10
@danny-avila
danny-avila marked this pull request as ready for review November 17, 2026 16:11
@danny-avila
danny-avila force-pushed the danny-avila/child-thread-pending-steers branch 4 times, most recently from ca6248b to 1d147a4 Compare November 17, 2026 17:03
@danny-avila
danny-avila force-pushed the danny-avila/child-thread-pending-steers branch 2 times, most recently from 419f776 to 4671032 Compare November 17, 2026 17:22
@danny-avila
danny-avila force-pushed the danny-avila/child-thread-pending-steers branch from 4671032 to b2fcc9a Compare November 17, 2026 17:36
@danny-avila
danny-avila merged commit b2fcc9a into dev Nov 17, 2026
57 of 58 checks passed
@danny-avila
danny-avila deleted the danny-avila/child-thread-pending-steers branch November 17, 2026 17:42
@danny-avila

Copy link
Copy Markdown
Collaborator Author

Folded into #18197. Its one commit (b2fcc9a) is now the head of that PR's branch, which is why this shows as merged into danny-avila/child-thread-pane; it reaches dev when #18197 merges. The reason: Codex's review of #18197 at its own head flagged, correctly, that the conversation body shipped without the waiting guidance and its Withdraw, which is what this PR adds. #18197's description now carries this one's mechanism, tests and captures.

An error occurred while trying to automatically change base from danny-avila/child-thread-pane to dev November 17, 2026 17:57
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.

1 participant