Repository navigation
docs(coderd/x/chatd): describe fork features in ARCHITECTURE.md - #272
Conversation
Replace the 53 fork TODO comments in chatd ARCHITECTURE.md with prose verified against the fork code: fork data classification, nested subagents (depth, caps, agent definitions, isolation), workflows, wake-ups (loop, caps, polling, controls), the /loop command, the interrupt cascade and family archive cleanup, fork chat routes, and the fork tools. Upstream TODOs and prose are untouched.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 81bca11f1d
ℹ️ 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".
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d9b15e3a85
ℹ️ 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".
Nine accuracy corrections against the code: events polls read process entries until one produces a message; live-cap admission also covers wake-up resumes; the worktree diff summary is skipped for timed-out waits; the acquisition fallback orders status then age; /loop requires a single text part; the family archive settle deadline is family-wide; the workflow startup sweep has no ownership tracking; an idle parent receives the workflow end notice directly; and the plugin pack restart sweep runs only when a pass has packs to write or stale packs.
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b826e3cd1d
ℹ️ 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".
Five accuracy corrections: awaiters that time out get a snapshot as of their timeout, not the final result; a due events wake-up with nothing ready just reschedules; the process output cursor advances only when a matching batch is delivered; re-setting a finished wake-up's status is a no-op and only a status change answers 409; and the fork also adds an async root ask_user_question.
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
…cture-fork-docs # Conflicts: # coderd/x/chatd/ARCHITECTURE.md
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Merged as
No |
Summary
Replaces every fork TODO in
coderd/x/chatd/ARCHITECTURE.mdwith prose describing what the fork code actually does today: 53TODO(ibetitsmike)andTODO(fork-chat-todos)comments gone, each replaced in place with concise prose matched to the surrounding section. No upstream line is reworded or reflowed; the five upstream TODOs (TODO(f0ssel),TODO (#29808)) and all upstream prose are untouched. Docs only; no code changes.Coverage: fork data classification (chat todos, descendant questions, secret answers, pinned skills, wake-ups, excluded plugin packs, organization wake-up caps, PR/process/output polling), the steer lane for async
ask_user_questionanswers, nested subagents (depth tracking, organization limits, concurrency and live caps,queued_for_capacity), agent definitions (custom types, tiers, tool policy, root resolution, depth 0 rows), subagent isolation (worktree, binding, wait report, workspace, definition default), workflows (step chats, runs, journal resume), family archive (lock order, isolation cleanup, wake-up cancellation), the/loopcommand, the interrupt cascade, the wake-up delivery loop and controls, acquisition candidate order, fork chat routes, and the fork tools.Premises that no longer matched the code
These TODOs described a state the code had moved past; the prose describes what the code does now:
fork_workflow_journal.gowritesworkflow_runsandworkflow_steps(chatdmig01a1d041), a startup sweep marks open runs of a dead processinterrupted, and resume replays the journaled script and steps. The prose drops the "later work" clause. The same TODO's "the first awaiter consumes the result" is reworded to what the code does: every awaiter gets the result snapshot; the queued end notice is only sent when no awaiter was waiting, and the nextawait_workflowdeletes it.FOR NO KEY UPDATEdoes not conflict with theFOR KEY SHAREforeign-key checks) and drops the reference.queued_for_capacityis stored state. It is derived on read (forkChatQueuedForCapacity); the prose reflects that.Evidence
One row per replaced TODO, verified against the current code. Line numbers refer to the TODO's position on
origin/mainbefore this PR.coderd/x/chatd/fork_chat_todos.go:51-85,130-160;coderd/database/forkdb/queries/chat_todos.sql:5-8coderd/x/chatd/fork_descendant_questions.go:227-263;coderd/database/forkdb/queries/chat_descendant_questions.sql:10-45coderd/fork_chat_questions.go:188-193,354-379;coderd/x/chatd/fork_secret_answers.go:40-97;coderd/database/forkdb/queries/chat_secret_answers.sql:6-11,16-26;coderd/database/dbpurge/fork_dbpurge.go:16-36coderd/fork_chat_pinned_skills.go:54-125;coderd/x/chatd/fork_pinned_skills.go:56-96coderd/x/chatd/fork_wakeups.go:129-166,246-308;coderd/database/forkdb/queries/chat_wakeups.sql:98-126coderd/x/chatd/fork_plugin_gate.go:282-335;coderd/database/migrations/chatdmig/nodes/01a1cf83-*chat_excluded_plugin_packs*coderd/x/chatd/fork_wakeup_caps.go:26-91;coderd/database/forkdb/queries/chat_organization_wakeup_caps.sqlcoderd/x/chatd/fork_pull_request_events.go:29-42,134-167,225-252;coderd/x/chatd/fork_wait_for_events.go:425-439,566-575coderd/x/chatd/fork_process_events.go:170-174,194-199,295-337,490-534,298-307coderd/x/chatd/fork_process_events.go:30-34,347-377,371-373,419-464;coderd/x/chatd/fork_wait_for_events.go:453-491,558-564site/src/pages/AgentsPage/components/ForkDescendantQuestionDock.tsx:73-75;site/src/api/queries/forkChatQuestions.ts:66-68;coderd/exp_chats.go:3310-3313;coderd/x/chatd/generation.go:1486-1524coderd/x/chatd/fork_subagents.go:355,366,389-400coderd/database/migrations/chatdmig/nodes/01a1bfc4-*chat_organization_subagent_limits*;coderd/x/chatd/fork_limits.go:49-72;codersdk/fork_chat_config.go:42-92coderd/x/chatd/fork_capacity.go:75-140;coderd/database/forkdb/queries/chat_capacity.sql:1-28coderd/x/chatd/fork_subagents.go:161-252,373-388,254-259;coderd/database/queries/lock.sql:1-6coderd/x/chatd/fork_capacity.go:150-192;coderd/x/chatd/chatd.go:1599-1616;coderd/x/chatd/fork_list_agents.go:29coderd/x/chatd/fork_agent_definitions.go:41-63,114-196;coderd/x/chatd/fork_subagents.go:393-400coderd/x/chatd/fork_agent_definitions.go:207-311;coderd/x/skills/skills.go:161-230coderd/x/chatd/fork_subagent_types.go:25-49,86-154coderd/x/chatd/fork_agent_tool_policy.go:32-45,189-258;coderd/database/forkdb/queries/chat_subagents.sql:4-8coderd/x/chatd/fork_root_agent.go:23-26,84-114coderd/x/chatd/fork_root_agent.go:155-231;coderd/database/forkdb/queries/chat_subagents.sql:10-14coderd/x/chatd/fork_agent_tool_policy.go:123-129,151-162;coderd/x/chatd/fork_root_agent.go:131,175-182;coderd/x/chatd/turn_environment.go:750-769coderd/x/chatd/fork_isolation.go:182-255,273-298;coderd/x/chatd/fork_subagents.go:335-343,389-403coderd/x/chatd/fork_isolation_binding.go:39-131,147-152,184-223coderd/x/chatd/fork_isolation_report.go:28,86-154coderd/x/chatd/fork_isolation_workspace.go:47-163,177-227coderd/x/chatd/fork_isolation.go:59-76,117-121;codersdk/workspacesdk/fork_agentdefinition.go:85,191-195coderd/x/chatd/fork_workflow_step.go:35-61,74-78,101-110,145-154,187-201coderd/x/chatd/fork_workflow.go:426-448,528-650,820-842;coderd/x/chatd/fork_workflow_journal.go:124-362coderd/fork_chat_routes.go:17-28,33-93,161-167coderd/x/chatd/fork_family_lock.go:28-117;coderd/database/forkdb/queries/chat_family_lock.sql:1-5;coderd/database/forkdb/queries/chat_subtree.sql:1-19coderd/x/chatd/fork_isolation_cleanup.go:48-133,180-225;coderd/x/chatd/chatstate/fork_notice.go:12-21coderd/x/chatd/fork_isolation_cleanup.go:124-140;coderd/x/chatd/fork_isolation_workspace.go:207-227;coderd/x/chatd/chattool/stopworkspace.go:37-141coderd/x/chatd/fork_family_lock.go:68-91;coderd/x/chatd/fork_wakeups.go:32,392-406;coderd/database/forkdb/queries/chat_wakeups.sql:80-90coderd/x/chatd/fork_loop_command.go:55-146;coderd/x/chatd/fork_schedule_wakeup.go:26-33,162-179,204-273;coderd/fork_chat_loop_errors.go:17-26coderd/x/chatd/fork_cascade.go:32-142;coderd/x/chatd/chat_mutations.go:540-552,902-920coderd/x/chatd/fork_wakeups.go:27-58,129-176,222-308;coderd/x/chatd/fork_wakeup_caps.go:117-166;coderd/database/forkdb/queries/chat_wakeups.sql:98-126coderd/x/chatd/fork_wakeup_controls.go:40-114;coderd/fork_chat_wakeups.go:121-150;coderd/database/forkdb/queries/chat_wakeups.sql:51-78,131-143coderd/database/queries/chats.sql:2559-2672;coderd/x/chatd/worker.go:169-215coderd/x/chatd/chatd.go:379-388;coderd/x/chatd/fork_plugin_gate.go:39-84,201-226;agent/agentcontext/fork_pack_mcp.go:257-274coderd/x/chatd/fork_search_chats.go:22-58;coderd/x/chatd/fork_wait_agent.go:37-39,59-113coderd/x/chatd/fork_tools.go:37-90; tool names infork_schedule_wakeup.go:26,fork_wait_for_events.go:29,fork_notify_user.go:24coderd/x/chatd/fork_workflow_report.go:584-659;coderd/x/chatd/stream_loop.go:272-276;coderd/x/chatd/tasks.go:717-726coderd/x/chatd/fork_subagents.go:425-501coderd/x/chatd/fork_descendant_questions.go:44-92,235-265,290-372;coderd/x/chatd/fork_tools.go:65-80coderd/x/chatd/fork_secret_answers.go:31-97,110-187coderd/x/chatd/fork_chat_todos.go:26-85,132-164;coderd/x/chatd/fork_chat_transcript.go:64-120;coderd/x/chatd/fork_list_agents.go:26-80;coderd/x/chatd/fork_context.go:41-161coderd/x/chatd/fork_plugin_gate.go:51-106,276-335;coderd/x/chatd/fork_plugin_drift.go:35-72coderd/x/chatd/fork_pack_materializer.go:40-51,104-183,185-232;coderd/x/chatd/turn_environment.go:465-466agent/agentcontext/fork_rules.go:238-254;coderd/x/chatd/context_prompt.go:262-300;coderd/x/chatd/fork_scoped_rules.go:32-125;coderd/x/chatd/turn_environment.go:470coderd/x/chatd/fork_pack_cleanup.go:45-152;agent/agentcontext/fork_pack_mcp.go:207-210coderd/x/chatd/fork_pinned_skills.go:36-96,147-161;coderd/x/chatd/fork_context.go:58-66;coderd/fork_chat_routes.go:130-135