Repository navigation
test(coderd): stamp chat message fixtures with the current content version - #30996
Conversation
|
@codex review
|
Codex Review SummaryThis 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: Didn't find any major issues. Swish! 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". |
There was a problem hiding this comment.
💡 Codex Review
The helper is named and documented as constructing a V1 row, but it uses the moving CurrentContentVersion alias. When a V2 codec is introduced, TestParseContent_V1 and every compatibility test using this helper will silently switch to V2 and stop covering V1 decoding. Assign chatprompt.ContentVersionV1 here, or rename and separate current-version fixtures from version-specific tests.
AGENTS.md reference: AGENTS.md:L86-L86
ℹ️ 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".
…coder exists Moving every fixture to the current format dropped coverage of the version 0 decoder, which this layer still ships: - TestParseContent_BackwardCompat and TestParseContent_V1 stay as on main, so the cases with current-format parts in version 0 rows still exercise the version 0 heuristics. The decoder removal moves them to version 1 rows. - TestProviderExecutedResult_LegacyToolRow writes its rows with the legacy writers again, so its provider-executed tool row goes through the legacy tool-row decoder. The tool call input normalization table also gains a JSON null input, which no test covered.
|
@codex review
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b5485db00c
ℹ️ 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".
Moving the malformed-input cases of TestParseContent_ErrorPaths to version 1 rows left the version 0 parsers, which this layer still ships, with no malformed-input test. Run the same input on version 0 rows of each role too, so a legacy parser that accepts malformed content fails the suite.
|
@codex review
|
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. 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". |
|
@codex review
|
|
Codex Review: Didn't find any major issues. 🎉 ℹ️ 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". |
|
@codex review
|
|
Codex Review: Didn't find any major issues. 👍 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". |
|
@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". |
|
@codex review
|
1 similar comment
|
@codex review
|
|
Codex Review: Didn't find any major issues. Swish! 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". |
|
@codex review
|
|
Codex Review: Didn't find any major issues. Another round soon, please! 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". |
Chat prompt tests built most of their stored-message fixtures in the legacy content format (
content_version0), so they exercised the legacy decoder instead of the current one. This PR changes tests only: it stamps those fixtures withContentVersionV1and builds them withMarshalParts, so they keep passing after the legacy decoder is removed later in this stack. Tests of the version 0 decoder itself keep their version 0 rows until the layers above remove that decoder.Why it is safe
mustMarshalContentandmustMarshalToolResultnow build current parts (PartFromContent,ChatMessageToolResult) and encode them withMarshalParts, the production write path.TestMixedFormatConversationbecomesTestConvertMessagesWithFiles_Conversationand uses current-format rows only.TestParseContent_BackwardCompatdoes not change. Migration 000434 stamped every existing row with version 0, so its six cases of current-format parts in version 0 rows still cover the version 0 heuristics. refactor(coderd)!: retire the V0 chat message content decoder #30998 moves those six cases to version 1 rows when it removes that decoder.TestProviderExecutedResult_LegacyToolRowcalls the legacy writers (MarshalContent,MarshalToolResult) directly, so its provider-executed tool row still goes through the legacy tool-row decoder.TestParseContent_ErrorPathsruns its malformed-input cases on version 1 rows, and runs the same input on version 0 rows of each role (v0/<role>/malformed_json), so a version 0 parser that accepts malformed content still fails the suite. refactor(coderd)!: retire the V0 chat message content decoder #30998 deletes the version 0 cases with that decoder.go test -overlayedit of the current decode and prompt-conversion code inchatprompt.go, against thechatpromptanddb2sdktests onmainand on this branch. Every mutantmaincatches is still caught. Two more are caught here: mutant 3, becauseTestParseContent_ErrorPaths/system/malformed_jsonused to hit the legacy system decoder, and mutant 14, by the new JSONnullcase ofTestConvertMessagesWithFiles_NormalizesAssistantToolCallInput. Mutants 4 and 8 survive those tests on both. ThechatdtestTestOrganizationSkillsFollowChatOwnerAccesscatches mutant 4, so 8 is an existing gap.mainand on this branch: version 0 assistant or user rows always take the envelope path, their current-format parts are dropped, legacy tool rows loseprovider_executed, or a version 0 parser accepts malformed JSON.ParseContentby an overlay, only tests of version 0 rows fail. test(coderd/x/chatd/chatprompt): drop tests of the legacy content codec #30997 deletes them, except the sixTestParseContent_BackwardCompatcases, which refactor(coderd)!: retire the V0 chat message content decoder #30998 moves, and the version 0 cases ofTestParseContent_ErrorPaths, which refactor(coderd)!: retire the V0 chat message content decoder #30998 deletes.The 17 mutants
ParseContentreturns no parts for a V1 row.decodeNulInParts).toolResultPartToMessagePart). Only achatdtest catches it.ProviderExecutedis dropped when reading.partsToMessageParts). Survives.ProviderExecutedis dropped when writing (PartFromContent).normalizeToolCallInputkeeps a JSONnullinput instead of{}. Survives onmainonly.ProviderExecutedis dropped.Review focus
The rewritten conversation test in
chatprompt_test.go. It checks the same prompt shape as before, but every row is in the current format. In the same file,TestProviderExecutedResult_LegacyToolRowkeeps its legacy rows,TestParseContent_ErrorPathschecks malformed input on both content versions, and the input normalization table gains a JSONnullcase. The other changed test files only switch fixtures to the current format:coderd/x/chatd/chatprompt/file_inline_test.go(+4/-16),coderd/database/db2sdk/db2sdk_test.go(+11/-13),coderd/x/chatd/message_conversion_test.go(+3/-2) andcoderd/x/chatd/quickgen_internal_test.go(+1).Validation
go test ./coderd/x/chatd/... ./coderd/database/db2sdk/ -count=1 -p 4 -parallel 4: okgo veton the touched packages andgolangci-lint run --fix=false ./coderd/x/chatd/chatprompt/...: cleanStack
This stack retires chatd compatibility paths for chat data that older Coder versions stored.
close_agenttool alias