Skip to content

fix: apply prompt suggestion toggle immediately - #3423

Merged
kev1n77 merged 1 commit into
GCWing:mainfrom
kev1n77:fmy/prompt-suggestion
Oct 16, 2026
Merged

kev1n77 merged 1 commit into
GCWing:mainfrom
kev1n77:fmy/prompt-suggestion

Conversation

@kev1n77

@kev1n77 kev1n77 commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

Make the existing prompt suggestion setting take effect immediately across the composer and prediction runtime.

  • Clear suggestions for the active host when the setting is disabled, including while the composer is unmounted, and reject late suggestion events.
  • Cancel an in-flight prediction when the execution host disables suggestions, and recheck the setting before returning a completed result.
  • Keep preferences isolated across device surfaces and hide suggestions while settings are unavailable or unsupported by an older host.
  • Add focused regression coverage for cancellation, disable/re-enable behavior, save failures, and host isolation.

Type and Areas

Type: Bug fix

Areas: Rust core, Web UI, AI settings, chat composer

Motivation / Impact

Previously, disabling prompt suggestions could leave an existing hint visible and allow an already-running prediction to finish. Turning the setting off now clears existing hints and cancels active prediction work. Turning it back on enables new predictions without restoring cleared hints.

Verification

  • pnpm run fmt:rs — passed.
  • cargo test --locked -p openbitfun-core --no-default-features --features agent-runtime,git --lib agentic::execution::prompt_suggestion::tests — 12 tests passed.
  • pnpm --dir src/web-ui run test:run src/flow_chat/store/promptSuggestionStore.test.ts src/flow_chat/hooks/usePromptSuggestionsEnabled.test.tsx src/app/scenes/settings/pages/ai/PromptSuggestionSection.test.tsx src/infrastructure/config/hooks/useAIExperienceSettings.test.tsx src/infrastructure/config/services/AIExperienceConfigService.test.ts src/flow_chat/services/flow-chat-manager/EventHandlerModule.test.ts — 92 tests passed.
  • pnpm run type-check:web — passed.
  • pnpm run check:web — blocked by 25 existing typography audit violations in five unchanged design-system files, verified identical to upstream/main.
  • Windows native desktop smoke test using pnpm run desktop:dev, real DeepSeek/GLM calls, and native WebDriver clicks on the settings switch: existing hints cleared approximately 64 ms after the toggle event; an in-flight prediction reached the cancellation path in approximately 32 ms; no late suggestion event appeared during more than 100 seconds of observation. A new turn while disabled made zero prediction requests, and re-enabling restored new suggestions. Temporary cancellation logging used for this observation was removed before committing.
  • Staged diff whitespace check — passed.

Reviewer Notes

Reuses the existing persisted setting, default, localized UI, and device-scoped configuration service. No persisted schema, protocol, or migration changes are introduced. Existing prediction prompts, model selection, reasoning fallback, and timeout behavior are preserved.

Live verification covered Windows local desktop only. Remote workspace, remote control, Peer Device Mode, and detached dispatch were not exercised with actual connections; host isolation and unsupported-host behavior have focused unit/component coverage. Cancellation evidence establishes client-side task cancellation, not termination of computation on the upstream model server.

Checklist

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above, or skipped checks are explained.
  • User-facing strings, docs, and locales are updated where applicable.

@kev1n77
kev1n77 merged commit 9d04c32 into GCWing:main Oct 16, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant