Repository navigation
fix(composer): trim prompt suggestion whitespace - #3632
Merged
bobleer merged 2 commits intoOct 30, 2026
Merged
Conversation
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.
Summary
Accepting a prompt suggestion with Tab could insert leading blank lines that were hidden in the single-line preview. Trim surrounding whitespace in the portable runtime before publishing suggestions and in the Web UI store for compatibility with older hosts. Preserve message-internal whitespace, line breaks, and indentation; ignore blank suggestions.
Type and Areas
Type: Bug fix
Areas: Agent Runtime prompt suggestions, Core suggestion integration contracts, Web UI suggestion store and event projection, focused verification guides.
Motivation / Impact
The runtime previously called
trim()only to detect empty or literalnulloutput, then returned the unmodified model text. The preview collapsed its whitespace while the composer preserved it. Preview and accepted text now use the same normalized suggestion, including when an older peer sends padded output.Verification
cargo test --locked -p openbitfun-core --no-default-features --features agent-runtime,git --lib agentic::execution::prompt_suggestion::tests— 10 passed (loopback provider response through event publication).cargo test --locked -p openbitfun-agent-runtime --no-default-features --features agent-runtime --lib prompt_suggestion::tests— 6 passed.pnpm --dir src/web-ui run test:run src/flow_chat/store/promptSuggestionStore.test.ts src/flow_chat/hooks/usePromptSuggestionsEnabled.test.tsx src/flow_chat/services/flow-chat-manager/EventHandlerModule.test.ts— 88 passed.pnpm run check:web— passed.pnpm run fmt:rsandgit diff --check— passed.node scripts/check-git-object-sizes.mjs --base upstream/main --head HEAD— passed.Reviewer Notes
AI-assisted; tested with focused automated checks. Coverage includes leading blank lines, CRLF, tabs, Unicode spaces, retained inner formatting, whitespace-only suggestions, legacy event payloads, and simulated local/Peer surface identities. No protocol or persisted shape changes are required.
Native desktop rendering and live Remote Workspace, Remote Control, Peer Device, and Detached Dispatch scenarios were not exercised. Detached/headless eligibility remains unchanged.
Checklist