Skip to content

fix(plugin): remember unsupported reasoning-effort routes per bridge - #2285

Closed
asyade wants to merge 1 commit into
MemTensor:mainfrom
asyade:fix/host-llm-effort-probe-cache
Closed

fix(plugin): remember unsupported reasoning-effort routes per bridge#2285
asyade wants to merge 1 commit into
MemTensor:mainfrom
asyade:fix/host-llm-effort-probe-cache

Conversation

@asyade

@asyade asyade commented Aug 26, 2026

Copy link
Copy Markdown

Problem

prepareAuxiliaryCall in the DeepSeek Harness adapter probes DSH'"'"'s branded off reasoning 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 doomed prepareCall, one logged UNSUPPORTED_REASONING_EFFORT error 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 failed capture.summarize preparations 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:

  • first call for a route: probe off → on UNSUPPORTED_REASONING_EFFORT, remember the route, prepare without effort (unchanged behavior);
  • later calls for a remembered route: go straight to the effort-less preparation;
  • models that do support off are unaffected — they keep getting the probe;
  • non-unsupported errors still propagate untouched and do not poison the cache.

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

  • new: "remembers an unsupported-effort route and probes it only once per bridge" — asserts the exact preparation sequence [off, plain, plain] across two completes;
  • new: "keeps remembered effort routes scoped to a single bridge instance" — guards against reintroducing module-global state;
  • existing suite passes unchanged (20/20 in tests/unit/adapters/deepseek-harness-host-llm.test.ts);
  • tsc -p tsconfig.json --noEmit clean.

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.
@Memtensor-AI Memtensor-AI added area:plugin OpenClaw & Hermes status:in-progress Someone or AI is working on it | 人工或 AI 正在处理 labels Aug 26, 2026
@Memtensor-AI

Copy link
Copy Markdown
Collaborator

🤖 Open Code Review

Target: PR #2285
Task: 392e613ed310c57b
Base: main
Head: fix/host-llm-effort-probe-cache

OpenCodeReview: Review complete: 0 finding(s) across 1 selected item(s).

Generated by cloud-assistant via Open Code Review.

@Memtensor-AI

Copy link
Copy Markdown
Collaborator

✅ Automated Test Results: PASSED

All 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: fix/host-llm-effort-probe-cache

@Memtensor-AI Memtensor-AI added status:ready Ready for implementation; waiting for assignee or AI dispatch | 可进入实现,等待认领或派发 and removed status:in-progress Someone or AI is working on it | 人工或 AI 正在处理 labels Aug 26, 2026
@asyade
asyade marked this pull request as draft August 26, 2026 13:30
@asyade

asyade commented Aug 26, 2026

Copy link
Copy Markdown
Author

Closing at the author's request — withdrawn for now.

@asyade asyade closed this Aug 26, 2026
@asyade
asyade deleted the fix/host-llm-effort-probe-cache branch August 26, 2026 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:plugin OpenClaw & Hermes status:ready Ready for implementation; waiting for assignee or AI dispatch | 可进入实现,等待认领或派发

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants