Repository navigation
docs(coderd/database/migrations/chatdmig): record the acquisition query rewrite as the one upstream query edit - #173
Merged
Conversation
…ry rewrite as the one upstream query edit
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. |
Owner
Author
Merge evidence for head |
This was referenced Nov 11, 2026
ibetitsmike
added a commit
that referenced
this pull request
Nov 11, 2026
…ry rewrite as the one upstream query edit (#173)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #170. Related to #8.
Records the fork's one edit to an upstream query in
coderd/database/migrations/chatdmig/README.md. #47 rewrote upstream'sGetChatWorkerAcquisitionCandidatesincoderd/database/queries/chats.sqlfor thefork-nested-subagentsfairness ranking, and regeneratedqueries.sql.goandquerier.go. The "Fork queries" rule says fork queries go toforkdbso that upstream's generated code never conflicts, and nothing wrote this exception down. The triage on #170 keeps the edit, so this PR documents it instead of moving it.unowned_chatsCTE, thefair_positionorder term, and theinterleave_subagentsbranch. It says why the edit stays in place: upstream's worker loop reads its candidates through this query, so aforkdbversion would be a full copy that an upstream change merges past without a conflict. It notes that the rewritten SQL also runs with the experiment off, and returns upstream's order then. It lists the sync steps: reapply the rewrite to upstream's version, keep upstream's candidate filter inunowned_chats, regenerate withmake geninstead of merging generated files, and run thecoderd/x/chatdtests that cover the ranking and upstream's order.coderd/x/chatd/ARCHITECTURE.mdis unchanged.Validation
markdownlint-cli20.16.0 on the README: 0 errors. The added lines have no em dashes, en dashes, spaced double hyphens, or semicolons.mainatce90b5bb74:git diff --numstat 99fb0da864 ce90b5bb74 -- coderd/database/queries/ coderd/database/queries.sql.go coderd/database/querier.golists onlychats.sql,queries.sql.go, andquerier.go. The only caller iscoderd/x/chatd/worker.go:171-175, withInterleaveSubagents: w.server.nestedSubagentsEnabled(). The named tests exist incoderd/x/chatd/fork_capacity_internal_test.goand upstream's unchangedagentadmission_internal_test.go. No file under.github/orscripts/mentions the query.