Repository navigation
Closed
Labels
pstack-paritypstack parity plan workstreams
Description
Xum created this issue on behalf of @ibetitsmike.
Part of #4.
Workspace brief from the pstack parity plan (local plan page "Running pstack on the Coder Agents Fork"; the PRD is local to Mike's Mac and not reproduced here). Claim numbers such as 1.3 or shared.2 refer to the plan page.
W4 · Todo list and transcripts · mike/todo-transcripts
Task. PRD 6.6 first, then 6.5, then the R12.3 check.
Background. The memory index already shows the pattern for a model-only message that returns after compaction (generation.go:458-470, called at :639; memory.go:87). GetChatMessagesByChatID has an after_id cursor and keeps only user and both visibility (chats.sql:414-425).
Scope.
chatd.chat_todos(plan 4.1);todo_writeandtodo_readthroughappendForkTools; a pubsub event per write; R6.4 a parent reads a child's list throughlist_agents.- Re-inject the list as a model-only message after a compaction boundary, next to
syncMemoryIndex. - UI panel above the composer through the W0 slot, live.
read_chat_transcript(R5.1, R5.2, R5.4): cursor pages, role and part filters, byte budget, existing tool-output truncation. Reads run as the chat owner (asOwner,chattool/listtemplates.go:437), never as chatd, which can read every chat. Descendants are allowed through theparent_chat_idwalk. Parts pass throughStripInternal(codersdk/chats.go:708-720) so provider metadata and credentials stay out.search_chats(R5.3) reusesdocs/coder-agents/chat-search-syntax.md. R5.5wait_agentlast N tool calls (subagent.go:710).- R12.3: confirm inline MP4 playback; fix only if it is missing.
Acceptance (PRD 6.5, 6.6).
- A todo list made before a manual
/compactis visible to the model and the user after it. - After compaction, a chat reads its own first user message verbatim.
- Inside a real chatd turn, a chat cannot read another user's unshared chat, and can read a chat shared with its owner.
- A transcript page with a reasoning part carries no provider metadata or credential fields.
- A root reads a grandchild's transcript (needs W2 merged; otherwise defer this one test).
Constraints. Experiment fork-chat-todos (one flag for todos and transcripts unless review asks to split).
Rules for every workspace
| Topic | Rule |
|---|---|
| Runner | One Xum workspace per brief (W0 runs as W0a and W0b), started from fork main at its wave start. Every implementation runs implement-flow with the workstream issue as its input and the brief as the plan. |
| Branches | mike/<topic> for the workspace; stacked PR branches mike/<topic>-<n>-<slug>. Local name equals remote name. Never push to main. |
| PR size | 500 changed lines at most per PR, generated code excepted (reviewer-friendly-pr). Stack with gh stack; the extension is not installed on the Mac today (gh extension install github/gh-stack), else use explicit-base PRs. |
| Schema | Fork tables are chatd graph nodes: go run ./coderd/database/migrations/chatdmig/cmd/chatdmig new <name> -requires <node or upstream:name>. Never edit a node that ran. No edits to dump.sql, queries.sql.go, querier.go, dbmock or numbered migrations. |
| Queries | coderd/database/forkdb only (created by W0). Every method goes through the forkdb authz wrapper. A forkdb write that belongs with an upstream write runs in the same transaction, through the W0 accessor (database.Store exposes only InTx, coderd/database/db.go:22-31). |
| Authorization | Chat-owned rows authorize through the owning chat (dbauthz.go:6513-6522 pattern). Agent and plugin rows reuse the skill RBAC objects. No new RBAC resources, no new API key scopes. Tools run as the chatd subject, which can read and update every chat (dbauthz.go:807-817): a tool that touches a chat other than its own runs as the owner (asOwner, chattool/listtemplates.go:437-443). |
| Upstream files | One hook line per hot file (plan shared.2). Logic lives in new fork files. Hot files: turn_environment.go, chatd.go, subagent*.go, codersdk/chats.go, deployment.go, dbauthz.go, chat_routes.go, AgentChatInput, AgentChatPageView. |
| Open upstream PRs | If a workspace needs an open coder/coder PR, W0 or W7 merges its branch into the fork with a merge commit. Its migrations go through chatdmig route into the chatd schema. Sync conflicts are solved later (Mike, 2026-11-08). |
| Flags | Each feature is behind its fork-* experiment in codersdk/fork_experiments.go. With the flag off, tool lists, routes and UI match upstream. |
| API | Swagger annotations on new public endpoints. Audited types update enterprise/audit/table.go. |
| chatd docs | coderd/x/chatd/ARCHITECTURE.md gets TODO lines only. Mike writes the text. |
| Validation | Go suites run in Colima: a postgres:17 container, plus golang:<go.mod version>-bookworm --network container:<pg> with volumes coder-gen-gomod and coder-gen-gocache and postgresql-client-17 from PGDG. chatdmig tests use CHATDMIG_TEST_DATABASE_URL='postgres://[email protected]:5432/postgres?sslmode=disable'. Never create a postgres role on the live Postgres. Frontend: site/AGENTS.md commands plus frontend-deep-review for any site/ diff. |
| Review | implement-flow ends with codex-review-loop; Codex is installed (2026-11-08). If @codex review gets no reply within 30 minutes, tell the lead and run code-quality-review with Opus until Codex answers. Mike (2026-11-09): fix real defects in the PR's own change; drop scope creep and defensive bikeshedding with a one-line reply and a resolved thread, no follow-up issue. Upstream is only a sync source: never report or file anything upstream. |
| UAT | coder-agents-uat through Coder MCP on the local deployment (http://127.0.0.1:3000, templates devcontainer or docker, RUNBOOK "Running a branch in a dev container workspace"). The remote agent runs scripts/develop.sh for the branch inside its workspace (plan decision uat). Never coder-local use a branch build: that replaces Mike's daily server. |
| Ready | When a PR meets the merge bar, send the lead (task_send_message to 8ac7791132) READY #<pr> <head sha> with the CI, Codex, UAT and open-thread evidence, then wait. Never merge yourself. |
| Merge | The lead merges (Mike, 2026-11-08). Merge bar: green fork-ci on the exact head, a clean Codex verdict, or Codex findings that were all fixed or dropped under the scope rule (the lead confirms each drop), no unresolved threads, UAT PASS on the head or on a SHA whose later commits only answer review, and a lead review of the diff against the brief. Squash, except sync and upstream stack PRs, which take a merge commit. A merge to fork main deploys Mike's daily server through autodeploy within about 5 minutes plus a drain of up to 30 minutes, so the lead merges one PR at a time and waits until Fork ops reports the deploy healthy. Experiments stay off on that server until Mike enables them. |
| Follow-ups | A defect in merged code or on the daily server becomes an issue in ibetitsmike/coder with label followup. Fork ops triages it; an accepted one gets its own workspace running implement-flow. |
Metadata
Metadata
Assignees
Labels
pstack-paritypstack parity plan workstreams
Activity
ibetitsmike commentedon Nov 9, 2026
Opened #32 (chat_todos node and fork queries), PR 1 of the W4 stack.
ibetitsmike commentedon Nov 9, 2026
W4 status: PR #32 (chatd.chat_todos node + forkdb queries) is READY at ebb62e6: fork-ci green, Codex findings fixed or dropped (owner TODO in chatd ARCHITECTURE.md left for Mike), UAT PASS on an upgrade from main. Next up: PR2 todo tools (stacked, opens after #32 merges), PR3 todo re-injection after compaction in progress.
ibetitsmike commentedon Nov 9, 2026
W4 status: #32 merged. #34 (todo_write/todo_read, pubsub, list_agents todos) is READY at 27ecac7 with green fork-ci, a clean Codex verdict and UAT PASS.
Follow-ups recorded here:
builtinPlanToolAllowedandexploreToolAllowedin turn_environment.go filter them, and the fork has one hook line in that file already. Letting them through needs a second hook or fork-side filtering; Mike's call.ibetitsmike commentedon Nov 9, 2026
Follow-up for the todo snapshot (#35), a product call for @ibetitsmike: after
/clear, the stored todo list goes back into the prompt like it does after compaction, the same as the project memory index. The UI keeps showing the list, so hiding it from the model would make the two disagree. If/clearshould drop the plan, the options are to clear the stored list with the context, or to skip the snapshot until the model callstodo_readortodo_writeagain. Raised by Codex on #35.ibetitsmike commentedon Nov 9, 2026
W4 follow-ups from Codex on #48 (
read_chat_transcript), both product calls for @ibetitsmike:/clear: the tool can read history from before a/clear, since/clearkeeps the transcript and the tool reads it. If/clearshould hide that history from the model, the tool needs to start at the latest clear boundary, which needs a new fork query (the chat row does not record the boundary). Xum's ownsession_historystops at a manual reset, for comparison.read_chat_transcripthas the same allowlist gap as the todo tools (recorded above).ibetitsmike commentedon Nov 9, 2026
W4 status: #48 (
read_chat_transcript) is READY at 79832c2. fork-ci is green, the Codex verdict is clean with 0 open threads, and UAT passed every transcript acceptance check, including a root reading its grandchild. Next up: PR6 (search_chatsand the last N tool calls inwait_agent).ibetitsmike commentedon Nov 9, 2026
W4 status:
search_chats) and feat(coderd/x/chatd): add include_tool_calls to wait_agent #53 (wait_agent include_tool_calls) are ready for the lead to merge. fork-ci is green on the exact heads, the Codex review is clean, all threads are resolved, and UAT passes.read_chat_transcript) is accepted and waiting for the lead to merge it.ibetitsmike commentedon Nov 9, 2026
W4 closeout
All W4 work is merged into fork
main(now68fbdea615), behindfork-chat-todosexcept where noted. With the experiment off, tool lists, routes and UI match upstream.Scope
chatd.chat_todosnode and forkdb queriesTestUpsertChatTodos,TestForkQueriertodo_writeandtodo_readthroughappendForkTools, a pubsub event per writeTestChatTodoTools(it also subscribes to the pubsub event for each write)TestForkChatTodos,TestForkChatTodosPermission,TestForkChatTodosWatch,TestForkChatTodosWatchResync,TestForkChatTodosExperimentOfflist_agentsTestForkListAgentsTestTodoSnapshotMessage(RestoredAfterCompaction,ClearedListAfterCompaction,NothingWhileToolCallsArePendingand others)read_chat_transcript(R5.1, R5.2, R5.4): cursor pages, role and part filters, byte budget, truncation, reads as the owner, descendants,StripInternalTestReadChatTranscript(PagesTheUserVisibleMessages,BoundsThePageSize,ReadsAsTheChatOwner,RejectsInvalidArguments)search_chats(R5.3)TestSearchChats(FindsTheOwnersTopLevelChats,FindsChatsSharedWithTheOwnerand others)wait_agentreturns the last N tool callsTestWaitAgentIncludeToolCallsForkAttachmentPreview.test.tsx, storiesAttachedVideo,ExperimentOff,ExpiredVideo.TestGetChatFileByteRangecovers the byte-range serving, which has no experiment gateOther: #55 regenerates the apidoc for the todo routes (closes #54) and adds a fork-ci drift check.
Acceptance (PRD 6.5, 6.6)
/compactis visible to the model and the user after it.TestTodoSnapshotMessage/RestoredAfterCompaction. In UAT, afterPOST /chats/{id}/compactthe model listed the right statuses, while the build before feat(coderd/x/chatd): restore the todo list after compaction #35 got them wrong./compact./compact,read_chat_transcriptreturned the first user message verbatim.PagesTheUserVisibleMessagescovers the paging.ReadsAsTheChatOwner(store wrapped indbauthz; reading as chatd fails it as a negative control). In feat(coderd/x/chatd): add the read_chat_transcript tool behind fork-chat-todos #48 UAT, during a real turn, an unshared admin chat was refused, and the same call succeeded after the admin shared it with the member. feat(coderd/x/chatd): add the search_chats chat tool #52FindsChatsSharedWithTheOwnercoverssearch_chatsthe same way.PagesTheUserVisibleMessages: a reasoning part with provider metadata, credential and identity set comes back without any of them.ReadsAsTheChatOwner(W2 was merged).Leaving this open for the lead to close.
ibetitsmike commentedon Nov 9, 2026
W4 is complete. Every scope item is merged into fork
mainand deployed (68fbdea615), as mapped in the closeout comment.On 2026-11-09 the daily server, running
68fbdea615with the fork experiments on, passed a five-item smoke test:buildinfoand/api/v2/experimentsmatch the deploy.todo_write,todo_read,read_chat_transcriptandsearch_chatsrun from a real chat.206and416, and a plain GET returns200with a matching sha256.attach_fileplays inline.Item 5 has one gap. With the turn's steps collapsed, the MP4 appears only as a download card in the turn's Attachments menu. That is tracked in #64.
Product calls left for @ibetitsmike:
/clearrestores the todo list.read_chat_transcriptcan read history from before a/clear.explorechildren don't get the todo tools (allowlist gap)./compactis covered by design, not by UAT. The panel reads the stored list through the feat(coderd): add the chat todo list routes #36 routes, and coderd has no path that deleteschat_todos.