Repository navigation
feat(coderd/x/chatd): add the notes tool behind fork-token-budget - #285
Conversation
@codex review |
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 65cefd956f
ℹ️ 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 |
|
Codex Review: Didn't find any major issues. Nice work! 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". |
…dget-compaction-96eae88d
Merged origin/main (#279, test only) so the branch is not behind main. @codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f39c4480b5
ℹ️ 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".
Answered and resolved both P2 findings on f39c448: neither is a regression, so I dropped them with the reasons in the threads. @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". |
…dget-compaction-96eae88d # Conflicts: # coderd/database/forkdb/sqlc.yaml # coderd/x/chatd/ARCHITECTURE.md
Merged origin/main (94caf1e, #280 and #282) with a merge commit. The @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". |
…dget-compaction-96eae88d
Merged origin/main (8674a00, upstream sync #312) with a merge commit and no conflicts. @codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! 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 c7efc9c (squash, Gates on head 8c5ce72:
Not exercised: the notes tool against a real model, and the chat_notes node applying to the live database. The tool is off unless |
Part of #283. This is PR 1 of 4 in the split from the design note.
What changed
fork-token-budget("Fork Token Budget"). It gates the whole token-budget stack. This PR adds only the notes tool.01a1d71e-84b7-78ae-99dd-2cb2e94742e3_chat_notesaddschatd.chat_notes. Each row has a chat ID, a path and content. It is keyed by (chat_id, path) and cascades on chat delete. Table checks hold the path pattern and the 16384 byte cap. No numbered migration.ListChatNotes,GetChatNote,WriteChatNoteandDeleteChatNote, with dbauthz and dbmetrics wrappers.WriteChatNotecreates a note only while the chat has fewer than 20 notes, and its append adds the content as a new line.notestool incoderd/x/chatd/fork_chat_notes.go. Its actions arelist,read,write,appendanddelete. The tool is bound to its own chat, so no other chat can read the notes, subagents included. The hook is oneifinfork_tools.go.docs/fork/pstack-adapter.md, with evidence lines.coderd/x/chatd/ARCHITECTURE.mdlists the table and the tool.Later PRs use the notes:
checkpoint.mdbecomes the hand-off for the next context window.Tests run
flock ~/.fork-go.lock go test -count=1 ./coderd/x/chatd/ -run TestChatNotesTool: pass. It runs through an authorizing dbauthz store and covers write, append, read, list order and sizes, delete, unknown actions, bad paths, the size cap on write and append, the 20 note cap, isolation between two chats, the plan-mode, explore and read-only filters, and no tool with the experiment off.flock ~/.fork-go.lock go test -count=1 ./coderd/database/dbauthz/ -run TestForkQuerier: pass.flock ~/.fork-go.lock go test -count=1 ./codersdk/ -run 'TestExperimentDisplayNames|TestForkExperiments': pass.flock ~/.fork-go.lock go test -count=1 ./coderd/database/forkdb/... ./coderd/database/migrations/chatdmig/...: pass.go run ./coderd/database/migrations/chatdmig/cmd/chatdmig check: pass.golangci-lintwith.golangci.new-code.yaml --new-from-merge-base=origin/mainon the changed packages: 0 issues.make lint/markdown lint/emdash lint/check-experiment-keys lint/architecture lint/agents lint/style-claims lint/migrations lint/docs-gen-filter: pass.Not verified
coderd/apidoc,docs/reference/api/schemas.md) were edited by hand with only the new experiment value, because a localmake genalso reordered unrelated enums.site/src/api/typesGenerated.tsis frommake gen.