Skip to content

fix(ai): accept local session chat replies - #213

Draft
scotej wants to merge 1 commit into
mainfrom
212-lower-prompt-refusa
Draft

fix(ai): accept local session chat replies#213
scotej wants to merge 1 commit into
mainfrom
212-lower-prompt-refusa

Conversation

@scotej

@scotej scotej commented Aug 10, 2026

Copy link
Copy Markdown
Owner

What changed and why

Fixes #212.

The attached Windows and macOS diagnostics show the in-session AI requests reaching the pinned llama-server, generating tokens, and returning HTTP 200. The failure was at the client contract: StudyVis requested generic JSON, then rejected any response that was not exactly a one-key reply_text object.

This change supplies llama.cpp b9095's supported json_object + schema contract, bounds the generated reply, and defensively accepts reply_text while ignoring non-executable extra fields. It also keeps fetch and response-body reads inside the request deadline and records privacy-safe outcome/shape diagnostics without prompts, topics, or replies.

Manual test

  • npm run tauri dev launched and the changed surface behaves as described
    not run: this environment has no Rust/desktop model runtime; the exact request, response, timeout, and cancellation paths are covered by unit tests
  • Checked in both themes and at reduced-motion — n-a: no rendered UI or motion changed; the existing Storybook interaction and accessibility suite passed

Compatibility surfaces

None. This does not change persistence, migrations, peer messages, identity derivation, settings, or release artifacts.

Gates

  • npm run build && npm run lint && npm run test — 1,252 tests passed
  • npm run check-tokens && npm run check-strings && npm run check-contrast
  • npm run check-migrations && npm run check-stories
  • npm run build-storybook && npm run check-a11y — 335 tests passed
  • cd src-tauri && cargo fmt --check && cargo clippy && cargo test
    no Rust changes / CI is the first compiler for this box
  • cd src-tauri && cargo deny checkno dependency changes; CI will run the supply-chain gate

Also verified Prettier, git diff --check, and version lockstep locally. The old diagnostics intentionally omitted model response bodies, so they prove the healthy transport/engine path but not the exact rejected extra key; the schema mismatch is the high-confidence code-level cause.

Merge style

  • Squash
  • Merge commit — because:

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d130b66c-3067-4f2d-aa48-789205d92895

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

Lower prompt refusa

1 participant