Skip to content

docs: map wake-ups and worktree binding in the pstack adapter - #139

Merged
ibetitsmike merged 5 commits into
mainfrom
mike/pstack-adapter-batch-wakeups
Nov 10, 2026
Merged

ibetitsmike merged 5 commits into
mainfrom
mike/pstack-adapter-batch-wakeups

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 #93 (the schedule_wakeup tool and the /loop command) and #135 (a subagent spawned with isolation: "worktree" is bound to its worktree). The page now says what fork main at 5a47dc7bed does.

  • Wake-ups (feat(coderd/x/chatd): add the schedule_wakeup tool and the /loop command #93). A new Wake-ups section covers schedule_wakeup behind fork-chat-wakeups:

    • its schedules, limits, and result fields;
    • the /loop [interval] <prompt> message;
    • how wake-ups are delivered;
    • that nothing lists or cancels a wake-up, so archiving the chat is the only early stop.

    The /loop, watchers, and PR and CI row now maps a pstack /loop 1h or watcher to running the step once and then schedule_wakeup with interval_seconds. It says to always set max_runs or expires_in_seconds, and keeps the in-turn wait as the fallback. The AGENTS.md block gets the same mapping, and the Questions section notes that a wake-up also continues a chat whose turn ended.

  • Worktree binding (feat(coderd/x/chatd): bind isolated subagents to their worktree #135). The Worktree isolation section drops the old workaround, where the parent sent the child its path with message_agent. It now covers:

    • the child working in its worktree, through a system message, execute with no workdir, and file tools resolving relative paths against it;
    • a relative workdir resolving against the worktree, and absolute paths and an absolute workdir still reaching the rest of the workspace;
    • a shared grandchild working in the same worktree;
    • repo_path now defaulting to the worktree that the parent works in, and the nested worktree path;
    • --force for removing a worktree with untracked files.

    The environment: "cloud" row matches.

  • Evidence. New entries cite fork_schedule_wakeup.go, fork_loop_command.go, fork_wakeups.go, and fork_isolation_binding.go. feat(coderd/x/chatd): bind isolated subagents to their worktree #135 moved ranges in fork_isolation.go, fork_subagents.go, fork_tools.go, and turn_environment.go, and they are updated. The Evidence line about the busy message_agent steer is gone with the workaround that needed it. The header names 5a47dc7bed. feat(site/src): show agent definition warnings in the context popup #137, merged after feat(coderd/x/chatd): bind isolated subagents to their worktree #135, changes only ContextUsageIndicator files that the page doesn't cite.

Validation

  • Block-match checks of every cited range in the four files that feat(coderd/x/chatd): bind isolated subagents to their worktree #135 changed, from 17ef3432d9 to b4dfdb922c: the moved ranges are updated, and the three changed ranges (fork_isolation.go:163-200, fork_subagents.go:193-202, fork_tools.go:47-49) were re-read and re-cited. No other cited file changed between the two commits.
  • markdownlint-cli2 0.16.0 on the page: 0 errors. The added lines have no em dashes, en dashes, spaced double hyphens, or semicolons outside &nbsp;.
  • UAT on the isolated 3100 server at 32bbba5265 with fork-chat-wakeups enabled only for this check, as a member:
    • schedule_wakeup rejected two schedules, a 30-second interval, a 4-field cron, timezone without cron, a prompt starting with /loop, and a cron wake-up that expires before its first run, each with the documented error.
    • A 60-second delay arrived 14 seconds after its time. An interval wake-up with max_runs: 2 waited while the chat was busy, ran twice, and completed with reason max_runs.
    • A chat whose first message was /loop 1m <prompt> stored only <prompt>, answered at once, and ran again every minute. /loop and /loop 5m failed with usage: /loop [interval] <prompt>, and /loop 31d x and /loop 30s x failed with the interval error.
    • After archiving, the /loop wake-up was canceled with reason archived at its next run.
  • UAT on the isolated 3100 server at b4dfdb922c with fork-subagent-isolation and fork-nested-subagents, as a member, in a scratch repo:
    • A worktree child's execute with no workdir ran in ~/.coder/worktrees/w7-q10-repo/<child chat ID> on agent/w7-q10-child-<8 hex>.
    • write_file with the relative path note.txt wrote into the worktree, as git status there showed. execute with workdir: "/tmp" ran in /tmp.
    • The child quoted the system message This chat works in its own git worktree at ... on branch ....
    • A shared grandchild ran in the same worktree and branch, read note.txt by its relative path, and quoted This chat shares its parent chat's git worktree at ....
    • A worktree grandchild with no repo_path got ~/.coder/worktrees/<child chat ID>/<grandchild chat ID>, branched from the child's HEAD.
    • Removing the child's worktree needed --force because of the untracked file.
  • Every test chat is archived, the worktrees, branches, and 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-10T12:34:03.792084Z 3822a25 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.

@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum acted for Mike on this comment.

@codex review

@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: fea930523d

ℹ️ 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 docs/fork/pstack-adapter.md Resolved
Comment thread docs/fork/pstack-adapter.md Resolved
Comment thread docs/fork/pstack-adapter.md Resolved
Comment thread docs/fork/pstack-adapter.md Resolved
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum acted for Mike on this comment.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 3822a25b1e

ℹ️ 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 (AI agent) closed and reopened this on behalf of @ibetitsmike.

Closing and reopening only to make GitHub recompute the merge ref against current main (3036142c68) and run fork-ci on it. The head is unchanged.

@ibetitsmike ibetitsmike reopened this Nov 10, 2026
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum (AI agent) closed and reopened this again on behalf of @ibetitsmike.

The merge ref now points at current main (3036142c68), but the run started by the first reopen was queued against the old merge ref. This second reopen starts fork-ci on the recomputed merge. The head is unchanged.

@ibetitsmike ibetitsmike reopened this Nov 10, 2026
@ibetitsmike
ibetitsmike merged commit 1be1a17 into main Nov 10, 2026
20 of 21 checks passed
@ibetitsmike
ibetitsmike deleted the mike/pstack-adapter-batch-wakeups branch November 10, 2026 12:51
@ibetitsmike

Copy link
Copy Markdown
Owner Author

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

Merge evidence for head 3822a25b1e22ef07a5fa1e96b2bb453620e7902c:

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