Skip to content

fix(mcp): set retryable false on the first unfinished-run tick - #24

Merged
linkerlin merged 1 commit into
masterfrom
cursor/pending-tick-retryable-false-1445
Nov 2, 2026
Merged

linkerlin merged 1 commit into
masterfrom
cursor/pending-tick-retryable-false-1445

Conversation

@linkerlin

Copy link
Copy Markdown
Owner

Summary

未完成 run 的第一次 swarm_tick 重定向现在也写 retryable=false。把缺席的 retryable 当成「可以再 tick」、只在严格 false 时才停、同时不看 tick_again / next_action / ok 的宿主,会在第一次软返回上停下来;ok 仍是 true,不会再掉进保险丝的 ok=false。gate_soft_continue 仍然缺席,不把严格 false 写回那个会被读成整段会话失败的字段。

The first unfinished-run swarm_tick redirect now sets retryable=false as well. Hosts that treat an omitted retryable as permission to tick again, and that ignore tick_again / next_action / ok, stop on that first soft return while ok stays true, so they do not fall through to the fuse's ok=false. gate_soft_continue stays omitted.

What changed

  • 未完成 run 的两次默认 tick(有软缺口与无软缺口)都写 retryable=false。第一次仍是 ok=true、没有 error、没有 loop_fuse,redirect_reason 仍是 pending_solidify。保险丝仍是 ok=false、loop_fuse=pending_redirect_loop、redirect_reason=pending_redirect_loop、没有 error。
  • 软缺口上 gate_soft_continue 仍然缺席。缺席不是 false:只把严格 false 当成整段会话失败、且不读 session_not_failed 的宿主不会在第一次就结束会话。只认这一个字段、完全不读 retryable 的宿主仍可能再 tick;把该键写成 false 会重开 DEBUG #67。
  • session_not_failed=true 与 preserve 三元组不动。boot / status 不写 retryable。不写 Parent baseline,不放宽固化门。DEBUG #61 的目录缓存没有做假修复。
  • 仪器、swarm_tick 参数说明、README(英/中)、quickstart、AGENTS、DEBUG #69 写同一口径。常驻 instructions 未加长(仍小于 1200)。

How to test

  1. uv run pytest tests/test_mcp_host_usability_pending_smoke.py tests/test_mcp_server.py tests/test_mcp_protocol.py tests/test_mcp_host_usability_p0.py tests/test_swarm.py -q --tb=line
    • Expected: 128 passed.
    • The new assertion (retryable is False on the first redirect, and a host that ticks unless retryable is strict false does not tick) fails on unmodified master.
  2. uv run ruff check src tests && uv run ruff format --check src tests && uv run mypy src
    • Expected: ruff clean, mypy Success: no issues found in 353 source files.
  3. Pre-existing, not part of this diff: uv run pytest tests/gep/test_material.py::TestWatermarkIngest::test_identical_rewrite_is_noop -q --tb=line still fails on unmodified master in this environment (skipped vs rewrite_noop). Identical write_text restores the previous mtime_ns, so the watermark fast-skip is doing what it says. Callers only read added. Not changed here.

Risk

Low. The unfinished-run tick envelope gains retryable=false on the first redirect, where it was previously absent. The fuse already had that value. ok on the first call stays true, so hosts that treat ok=false as session death do not die on the accidental first tick. gate_soft_continue is still omitted. Solidify gate, skip_validation, Parent baseline, and val seal are unchanged.

Harness/evaluator governance

Upstream governance surface: MCP swarm_tick unfinished-run redirect envelope (retryable only). Not solidify, selector, mutation, or the frozen gate.
Downstream EvoX impact: N/A -- existing tool return field, no bridge or contract change.
Rollout-local scope: host-visible tick redirect only; boot and status are unchanged.
Promotion boundary: N/A -- no proposal/rollout/default promotion.
Evaluator mismatch sets: N/A
Non-regression evidence: tests/test_mcp_host_usability_pending_smoke.py pins the first redirect (ok true, retryable false, gate_soft_continue omitted, session_not_failed true) and the fuse (ok false unchanged).
Fix-severity review: low
Owner approval: N/A
Security boundary: no new data, tool, host, network, or secret surface.
Rollback: revert this commit.
Live promotion: no
Autonomous evaluator self-editing: no

Self-check

  • No new runtime dependencies without a clear justification in "What changed".
  • Tests added or updated to cover the new behavior; gates pass locally: uv run pytest (modules listed above), uv run ruff check src tests, uv run ruff format --check src tests, uv run mypy src.
Open in Web Open in Cursor 

Hosts that treat an omitted retryable as permission to tick again stop
on the first soft redirect. ok stays true, and gate_soft_continue stays
omitted so a strict false is not read as session death.

Co-authored-by: Steper Lin <linker.lin@live.com>
Copilot AI balanced review requested due to automatic review settings November 2, 2026 17:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@linkerlin
linkerlin merged commit 64f7abb into master Nov 2, 2026
5 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.

3 participants