Skip to content

docs: map wait_for_events and the wait_agent worktree summary in the pstack adapter - #148

Merged
ibetitsmike merged 3 commits into
mainfrom
mike/pstack-adapter-batch-wake-events
Nov 10, 2026
Merged

ibetitsmike merged 3 commits into
mainfrom
mike/pstack-adapter-batch-wake-events

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

Part of #13 and #8.

Updates docs/fork/pstack-adapter.md for #106 (wait_for_events) and #141 (the worktree summary in wait_agent), and re-pins the citations that #106 and #143 moved. The page now says what fork main at 976f8fce6d does.

  • wait_for_events (feat(coderd/x/chatd): wake a chat when its child agents finish #106). The Wake-ups section now says that, with fork-chat-wakeups, a chat also has wait_for_events, except in plan-mode turns and explore children. It covers:
    • call it, then end the turn, and the chat gets one user message per watched child when that child is done, one message per turn;
    • child_chat_ids (up to 50 direct children, default every child still working), prompt (default asks you to read the result with wait_agent), and expires_in_seconds (60 seconds to 30 days, default 24 hours);
    • when a child counts as done, including that a child with an unanswered question or its own wait_for_events still waits;
    • the result fields, the error messages, and the shared limit of 10 wake-ups.
      The Questions section, the run_in_background: true row, the watchers row of the missing-features table, and the adapter block now point to wait_for_events.
  • Worktree summary in wait_agent (feat: summarize isolated subagent worktrees in wait_agent #141). The Worktree isolation section now says that wait_agent on a worktree child adds isolation, branch, and worktree_path, and, unless the wait times out, diff_summary with commits, files_changed, insertions, deletions, and uncommitted_changes, or diff_summary_error when the worktree can't be read.
  • Evidence. New entries cite fork_wait_for_events.go, fork_isolation_report.go, and agent/agentgit/fork_worktree_summary.go. feat(coderd/x/chatd): wake a chat when its child agents finish #106 moved ranges in fork_tools.go, fork_schedule_wakeup.go, and fork_wakeups.go, and fix: port the final computer use validation from upstream #31895 #143 moved chatloop.go:1460 and codersdk/chats.go:1953, and they are updated. The header names 976f8fce6d.

Validation

  • Block-match checks of every cited range in the files changed from 77b20734d2 to 976f8fce6d: the moved ranges are updated, and the changed ones (fork_tools.go:35-38, fork_schedule_wakeup.go:160-202, fork_wakeups.go:28, :235-252, :315-351, and the agent's delete checks in fork_worktrees.go) were re-read and re-cited.
  • markdownlint-cli2 0.16.0 and markdown-table-formatter 1.6.1 on the page: 0 errors, no changes. The added lines have no em dashes, en dashes, spaced double hyphens, or semicolons outside  .
  • UAT on the isolated 3100 server at 976f8fce6d, as a member, with fork-chat-wakeups and fork-subagent-isolation enabled. Details are in the gate comment.
    • wait_for_events without children failed with no running child agents to wait for, a second call failed with the already watched error, and a non-child ID failed with is not a child of this chat.
    • With two running children, the call returned both, the root ended its turn, and it got one Child agent "<title>" (<id>) is done with status waiting. message per child, the second only after the first message's turn ended.
    • wait_agent on the worktree child returned timed_out: true and no diff_summary with a 5-second timeout, and after the child finished, diff_summary with 1 commit, 1 file, 2 insertions, and 2 uncommitted changes (an edited tracked file and an untracked file).
    • Every test chat is archived, the kept worktree, its branch, and the scratch repo are removed, the workspace is stopped, and the ops agent restores the server's daily experiments.
  • Docs only. No code change.

Xum opened this PR on behalf of @ibetitsmike.

@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum acted for Mike on this comment.

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 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-10T15:30:19.844393Z 6d5b493 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. 🚀

Reviewed commit: 6d5b493d2a

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

@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum acted for Mike on this comment.

UAT on the isolated 3100 server at v2.39.1-devel+976f8fce6d, as a member in uat3100-smoke, with the daily 6 experiments plus fork-subagent-isolation and fork-chat-wakeups:

  • A root chat with no children called wait_for_events and got no running child agents to wait for.
  • A root chat spawned w7-g148 A with isolation: "worktree" in a scratch repo (commit a.txt, then append to a.txt, write an untracked b.txt, and sleep 60 seconds) and w7-g148 B without isolation (sleep 100 seconds).
    • wait_agent on A with timeout_seconds: 5 returned timed_out: true with isolation, branch, and worktree_path, and no diff_summary.
    • wait_for_events with no arguments, while both children ran, returned id, expires_at 24 hours later, and children with both children's chat_id, title, and status: "running".
    • A second call returned these child agents are already watched by wake-up 90bc933d-...: end your turn to wait for them, and child_chat_ids: ["00000000-0000-0000-0000-000000000001"] returned chat 00000000-0000-0000-0000-000000000001 is not a child of this chat.
  • The root ended its turn at 17:28:31 (local), and got the user message A child agent you were waiting for is done. Read its result with wait_agent, then continue. followed by an empty line and Child agent "w7-g148 A" (08d1932d-...) is done with status waiting. at 17:28:37.
    The message for w7-g148 B arrived at 17:30:23, after the turn that A's message started ended at 17:30:14.
  • wait_agent on A then returned diff_summary {"commits":1,"files_changed":1,"insertions":2,"deletions":0,"uncommitted_changes":2}: the uncommitted append to a.txt counts in insertions, and the untracked b.txt counts only in uncommitted_changes.
  • Both test chats are archived, the kept worktree, its branch, and the scratch repo are removed, and the workspace is stopped.

@ibetitsmike
ibetitsmike merged commit 5f6b636 into main Nov 10, 2026
11 checks passed
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum (AI agent) merged this on behalf of @ibetitsmike.

Merge evidence for head 6d5b493d2a27e3e3ed2ccf3ffc9d16b3a060d2a4:

  • Docs only (docs/fork/pstack-adapter.md). fork-ci pull_request run 42845170375 passed on this head; it merged cleanly onto main after feat(coderd): spawn subagents into their own workspace with isolation workspace #144, and main fork-ci on the squash commit gates the deploy. All checks green.
  • Codex on this exact head: no major issues (comment 6771478831). 0 unresolved review threads.
  • Gate on :3100 at 976f8fce6d with the wake-up and isolation experiments on: wait_for_events errors, one message per finished child (the second after the first turn ended), wait_agent timeout without diff_summary, and a worktree child's diff_summary (1 commit, 1 file, 2 insertions, 2 uncommitted) matched the rows (gate comment 6773044003). Cleanup verified by Fork ops.

@ibetitsmike
ibetitsmike deleted the mike/pstack-adapter-batch-wake-events branch November 10, 2026 17:14
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