Skip to content

fix(loop): O13 recover thinking-only turns by lowering reasoning - #82

Merged
QiaolongLi1201 merged 2 commits into
mainfrom
fix/o13-thinking-only
Oct 11, 2026
Merged

QiaolongLi1201 merged 2 commits into
mainfrom
fix/o13-thinking-only

Conversation

@QiaolongLi1201

Copy link
Copy Markdown
Collaborator

Summary

O13 (P0): recover thinking-only turns by raising the retry budget and lowering/turning off reasoning per provider on each retry, instead of aborting after two reasoning-only turns.

未找到原始 run1

Shared box has no /workspace/moss-self/run1. Mac (~/Desktop/RDK_Studio and common paths) also has no moss-self/run1 directory or logs. Root cause below is code-verified against current main + backlog text (G6/O13 in docs/plan/moss-roadmap.md), not against original run1 logs.

Root cause (code-verified)

  1. THINKING_ONLY_RETRY_BUDGET = 1 → second thinking-only turn threw The model returned private reasoning twice without a visible answer.
  2. Retries only injected a system nudge; request reasoning was unchanged; under adaptive it could even rise to high.
  3. Thinking-only assistant turns were dropped from the buffer (not changed in this PR — provider signature risk; separate follow-up).

Fix

  • Budget 1 → 2 (stop after 3 consecutive thinking-only turns).
  • thinkingOnlyReasoningOverride(provider, attempt, modelId): attempt 0 → low; attempt 1 → off when provider/model matches zai|zhipu|glm|deepseek|qwen|dashscope|kimi|moonshot, else low.
  • One-shot state.reasoningOverrideNextTurn consumed in agent-loop-llm-call.ts (cleared after use; wins over adaptive high).
  • Error text uses THINKING_ONLY_RETRY_BUDGET + 1.
  • Does not touch src/safety/** or git-config-env.ts. Does not start O70/O80.

Files

  • src/core/loop/agent-loop-post-llm.ts
  • src/core/loop/agent-loop-llm-call.ts
  • src/core/loop/agent-loop-response.ts
  • src/core/loop/agent-loop-state.ts
  • src/core/loop/agent-loop.ts
  • test/o13-thinking-only-recovery.spec.mjs (new)
  • test/agent-loop-post-llm.spec.mjs (budget assert 1→2)

Tests

npm run test:filter -- --filter o13                 # PASS
npm run test:filter -- --filter agent-loop-post-llm # PASS
npm run test:filter -- --filter output-limit        # PASS
npm run test:filter -- --filter nudge               # PASS (15 files)
npm run smoke                                       # PASS
prettier --check + eslint on touched files          # clean

Coverage: two thinking-only turns do not abort; still thinking-only after budget → clear error (never treat empty answer as success); glm override low→off; Anthropic stays low.

B1 full suite not re-run (token cost); related loop unit tests + smoke green. No safety path changes.

Live glm-5.3 ×3

Because original run1 prompt is missing, ran the same new bootstrap-style read-only probe three times (task.txt in gist): read post-llm + llm-call sources and produce a visible summary. Model glm-5.3 via D-Robotics gateway, --max-turns 25, debug on.

# exit time thinking-only abort? visible answer log
1 0 28s no (verified) yes gist run-1.log
2 0 41s no (verified) yes gist run-2.log
3 0 33s no (verified) yes gist run-3.log

English "private reasoning … times in a row" strings in the logs are quoted in the model answer, not runtime throws (exit 0). Long-context 180k-token original self-host path was not replayed (no run1) — noted as uncovered.

Accept write-up + logs: https://gist.github.com/QiaolongLi1201/7981751ab23566e604266d5790764c95

Base

59c7ee7b (main after #79 O79 + #81 O57/O83).

Follow-ups

  • O70 / O80 not in this PR.
  • Optional later: re-inject dropped thinking summaries (provider signature constraints).

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@QiaolongLi1201
QiaolongLi1201 merged commit 95f7108 into main Oct 11, 2026
10 of 12 checks passed
@QiaolongLi1201
QiaolongLi1201 deleted the fix/o13-thinking-only branch October 12, 2026 10:29
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