fix: surface safe terminal tool fallbacks#90872
Conversation
f360f5f to
768d38d
Compare
|
Thanks for the contribution. I reviewed the branch, and this PR is not a good landing base for OpenClaw. Close: the terminal-fallback problem is useful, but this branch is no longer a viable landing base after an explicit maintainer rejection and code inspection showing broad public SDK, core tool-contract, and embedded-runner rewrites. So I’m closing this PR rather than keeping an unmergeable branch open. A new narrow PR that carries only the useful part is welcome. Review detailsBest possible solution: Close this branch as the landing candidate and pursue a narrow replacement PR that fixes one terminal-fallback delivery path, with any public Plugin SDK API handled as a separate maintainer-approved contract change. Do we have a high-confidence way to reproduce the issue? No high-confidence reviewer-run reproduction was established in this read-only pass. The PR's redacted live Discord proof and source inspection make the reported terminal fallback failure plausible, but current-head behavior was not independently reproduced. Is this the best way to solve the issue? No. This branch is a plausible exploration, but the best maintainable solution is a much narrower runtime repair plus a separate product/API decision for durable Plugin SDK fallback metadata. Security review: Security review cleared: No concrete security or supply-chain regression was found; the diff does not add dependencies or workflows, but any replacement must keep terminal fallback output explicitly public and redacted. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against f1b8827d20c8. |
|
Visual verification request: verify a Discord-backed run surfaces safe scheduler/web_fetch terminal fallback without raw tool output. |
768d38d to
fdd98e0
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
fdd98e0 to
d541d51
Compare
d541d51 to
72faa63
Compare
72faa63 to
8f274c9
Compare
# Conflicts: # docs/.generated/plugin-sdk-api-baseline.sha256
# Conflicts: # docs/.generated/plugin-sdk-api-baseline.sha256
# Conflicts: # src/agents/embedded-agent-runner/run/attempt.ts # src/agents/embedded-agent-runner/run/incomplete-turn.ts
|
We are not landing this. This is 15k LOC and can't possibly be the right approach. |
|
Closing as superseded by #93073. This PR established the real Discord-facing failure and contains useful investigation/proof history, but the 75-file, +15,999/-1,907 approach adds broad public tool/fallback contracts and is not the implementation we want to land. #93073 carries the motivating evidence forward and replaces this with a narrow typed post-tool empty-final recovery using the existing bounded continuation, with fail-closed replay handling for unclassified tools and no natural-language regex parsing or raw-result fallback. Please continue implementation review and proof discussion on #93073. Reopen this PR only if concrete evidence shows a distinct required behavior that the narrow replacement cannot cover and that requires the broader public fallback contract. |
|
Superseded by #93228. The replacement keeps this PR's goal, but removes the natural-language classifier and large English-specific regular expressions. It uses explicit harness/protocol terminal states, structured replay-safety evidence, and post-middleware tool summaries instead. The original contribution remains credited through Thank you @fuller-stack-dev for identifying and implementing the original safe-terminal-fallback direction. |
Summary
cronandweb_fetch, and keep Docker image builds from carrying staledistoutput.Contract note
terminalSummaryandterminalResultFallbackare intentionally public tool metadata for safe terminal presentation.defineToolPluginpreserves intentional helper-created tool results while continuing to JSON-wrap bare text-shaped objects withcontentanddetailsfields.Verification
node scripts/run-vitest.mjs src/plugin-sdk/tool-plugin.test.ts src/agents/embedded-agent-runner/run.incomplete-turn.test.ts src/agents/embedded-agent-subscribe.handlers.tools.test.ts src/auto-reply/reply/agent-runner.runreplyagent.e2e.test.ts -- --reporter=dotpnpm check:docspnpm lint --threads=8pnpm plugin-sdk:api:check.agents/skills/autoreview/scripts/autoreview --mode branch --base upstream/main --codex-bin /Users/jason/.codex/openclaw-pr-autopilot/bin/codex-persist-sessions --model codex=gpt-5.5 --thinking codex=highgit diff --checkReal behavior proof
Behavior addressed: Channel-facing agents that ended a turn after successful tool work could reply with planning text, repeat promises, or expose unsafe raw fallback text instead of delivering the completed tool result.
Real environment tested: A live Discord-backed OpenClaw stack using the patched image and a connected bot. Identifying stack, bot, channel, image, and run IDs are intentionally omitted from this public PR.
Exact steps or command run after this patch: Sent live prompts that exercised a scheduler/cron path and a
web_fetchtool-loop timeout path through the running gateway.Evidence after fix:
Redacted live channel output, scheduler path:
Redacted live channel output,
web_fetchterminal fallback path:Observed result after fix: The channel received user-visible results for both proof cases. The
web_fetchfallback included URL, final URL, status, title, cache state, and truncation state, with no raw unsafe tool dump. The scheduler path returned a direct capability blocker instead of a promise to perform an unavailable check.What was not tested: Broad cross-channel E2E beyond Discord was not rerun. One unrelated live runtime metadata drift was observed during proof and is omitted here because it is not part of this patch.