fix(studio): keep prompt_builder.dart out of the Studio assembly files - #387
Merged
Merged
Conversation
`prompt_build_architecture_test.dart` forbids the literal string `prompt_builder.dart` in the six Studio request-assembly files, so the ordinary prompt path cannot creep back into them. Two comments in `StudioMessageBuilder` name the file — there is no import and no `PromptPayload` / `PromptResult` use, only the wording — and they have been failing that test on `nightly` since #385, which reddens CI for every PR opened against it. - reword the `appendToLastMessage` comments in `lib/core/llm/studio_message_builder.dart` to point at "the ordinary prompt builder" instead of naming the file The test's contract is untouched: it stays as strict as it was, and no behaviour changes — the diff is two comments. Verified: reproduced the failure on 824e4ef, then `flutter test test/prompt_build_architecture_test.dart` and `test/studio_typed_message_builder_test.dart` pass with the change; `flutter analyze` clean on the file. `dart format` is deliberately not run — it rewrites this file wholesale on the base commit too, and CI has no formatting step. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137NTHNxY3UPZ4iwrnyW1jU
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.
prompt_build_architecture_test.dart› "Studio request assembly excludes ordinary prompt artifacts" fails onnightly(824e4ef), so CI is red on every PR opened against it — including #386, whose diff does not touchlib/core/llm/at all.The test forbids the literal string
prompt_builder.dartin the six Studio request-assembly files, so the ordinary prompt path cannot creep back into them.lib/core/llm/studio_message_builder.dartnames it in two comments added by #385 (lines 115 and 559). There is no import and noPromptPayload/PromptResultuse — it is the wording alone that trips the contract.Changes
appendToLastMessagecomments inStudioMessageBuilderto point at "the ordinary prompt builder" instead of namingprompt_builder.dart, and rewrap the affected linesThe test itself is left exactly as strict as it was, and no behaviour changes: the diff is two comments.
Verification
flutter test test/prompt_build_architecture_test.dart→+3 -1), then confirmed the same file passes with the change (+4).flutter test test/studio_typed_message_builder_test.dart— 16/16, so theappendToLastMessagepath the comments describe is still covered.flutter analyze --no-fatal-infos --no-fatal-warnings lib/core/llm/studio_message_builder.dart— no issues.dart formatwas deliberately not run on the file: it rewrites it wholesale on the base commit too, so running it here would bury a two-comment fix under an unrelated reformat. CI has no formatting step.🤖 Generated with Claude Code
https://claude.ai/code/session_0137NTHNxY3UPZ4iwrnyW1jU
Generated by Claude Code