fix(plugin): remember unsupported reasoning-effort routes per bridge - #2285
Closed
asyade wants to merge 1 commit into
Closed
fix(plugin): remember unsupported reasoning-effort routes per bridge#2285asyade wants to merge 1 commit into
asyade wants to merge 1 commit into
Conversation
prepareAuxiliaryCall probes the branded `off` effort before every auxiliary call and falls back when the exact model rejects it. Models that advertise no efforts at all reject it every time, so each summarize/retrieval-filter paid one doomed prepareCall, one logged UNSUPPORTED_REASONING_EFFORT error, and a retry before its real request. Each bridge now remembers the routes that rejected the probe (keyed by provider/model) and skips the probe on later calls. The memory is scoped per bridge instance, so concurrent bridges stay independent and tests remain hermetic.
Collaborator
🤖 Open Code ReviewTarget: PR #2285 ✅ OpenCodeReview: Review complete: 0 finding(s) across 1 selected item(s). Generated by cloud-assistant via Open Code Review. |
Collaborator
✅ Automated Test Results: PASSEDAll tests passed (20/20 executed). memos_local_plugin/unit: 20/20. Duration: 3s [advisory, non-gating] AI-generated tests on branch test/auto-gen-392e613ed310c57b-20260826190007: 41/43 passed, 2 failed — these do NOT affect the PR verdict; review the branch manually. Branch: |
15 tasks
asyade
marked this pull request as draft
August 26, 2026 13:30
Author
|
Closing at the author's request — withdrawn for now. |
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.
Problem
prepareAuxiliaryCallin the DeepSeek Harness adapter probes DSH'"'"'s brandedoffreasoning effort before every auxiliary LLM call, and falls back to an effort-less preparation when the exact model rejects it. That fallback is correct — but for models that advertise no reasoning efforts at all (e.g. a hand-declared OpenAI-completions entry), the probe fails every time, so each summarize / retrieval-filter call pays one doomedprepareCall, one loggedUNSUPPORTED_REASONING_EFFORTerror row, and a retry before doing any real work.Observed in production while running the plugin (2.0.16) against DeepSeek Harness with OpenCode'"'"'s
x-preview-f-free: the harness-side api log accumulated 1,220 failedcapture.summarizepreparations vs 191 successes, and 1,267 failed retrieval filters vs 106 ok — every success reached only through the fallback retry, doubling round trips and flooding the log.Fix
Each bridge now remembers the routes that rejected the probe (keyed by
provider/model) and skips the probe on later calls:off→ onUNSUPPORTED_REASONING_EFFORT, remember the route, prepare without effort (unchanged behavior);offare unaffected — they keep getting the probe;The memory is scoped per bridge instance (closure state, not module-global), so concurrent bridges stay independent and unit tests remain hermetic across cases.
Tests
"remembers an unsupported-effort route and probes it only once per bridge"— asserts the exact preparation sequence[off, plain, plain]across two completes;"keeps remembered effort routes scoped to a single bridge instance"— guards against reintroducing module-global state;20/20intests/unit/adapters/deepseek-harness-host-llm.test.ts);tsc -p tsconfig.json --noEmitclean.