Skip to content

fix(codex): extend skill_workshop dynamic-tool timeout above approval ceiling#91325

Closed
openperf wants to merge 1 commit into
openclaw:mainfrom
openperf:fix/91266-skill-workshop-approval-timeout
Closed

fix(codex): extend skill_workshop dynamic-tool timeout above approval ceiling#91325
openperf wants to merge 1 commit into
openclaw:mainfrom
openperf:fix/91266-skill-workshop-approval-timeout

Conversation

@openperf

@openperf openperf commented Jun 8, 2026

Copy link
Copy Markdown
Member

Summary

  • Problem: skill_workshop lifecycle tool calls (apply/reject/quarantine) invoked from a Codex agent session fail with "OpenClaw dynamic tool call timed out after 90000ms while running tool skill_workshop" before the operator approval prompt can resolve. The proposal is left pending and unmodified. The same failure occurs on the /btw side thread.
  • Root Cause: The Codex dynamic-tool bridge wraps every tool call with a per-tool watchdog (CODEX_DYNAMIC_TOOL_TIMEOUT_MS = 90_000). Skill Workshop lifecycle calls return a requireApproval payload that waits up to DEFAULT_PLUGIN_APPROVAL_TIMEOUT_MS = 120_000 plus 10s gateway grace (130s total). The watchdog fires at 90s, before the approval can complete. Additionally, before_tool_call hooks can escalate a non-lifecycle action (e.g. inspect → apply) at runtime, after the timeout has already been resolved from the original arguments — so an action-gated 90s timeout would still fire on the hook-adjusted path.
  • Fix: Return CODEX_DYNAMIC_SKILL_WORKSHOP_TOOL_TIMEOUT_MS = 150_000 for all skill_workshop calls in both readConfiguredDynamicToolTimeoutMs (main thread) and resolveSideDynamicToolCallTimeoutMs (side thread). The 150s deadline exceeds the 130s approval ceiling; the unconditional match is correct because the timeout is resolved before hooks run and any action can be escalated to a lifecycle call at runtime. Non-lifecycle calls (list, inspect) complete in milliseconds so the wider window has no practical effect.
  • What changed:
    • extensions/codex/src/app-server/dynamic-tool-execution.ts — exported CODEX_DYNAMIC_SKILL_WORKSHOP_TOOL_TIMEOUT_MS = 150_000; added unconditional skill_workshop branch in readConfiguredDynamicToolTimeoutMs.
    • extensions/codex/src/app-server/side-question.ts — added CODEX_SIDE_DYNAMIC_SKILL_WORKSHOP_TOOL_TIMEOUT_MS = 150_000; added unconditional skill_workshop arm in resolveSideDynamicToolCallTimeoutMs.
    • extensions/codex/src/app-server/dynamic-tool-execution.test.ts — extended deadline test covers all five action types; fake-timer before/after proof unchanged.
    • extensions/codex/src/app-server/side-question.test.ts — new test: all five action types return 150s on the side-thread path.
  • What did NOT change (scope boundary):
    • Skill Workshop approval policy (src/skills/workshop/policy.ts) unchanged; the 120s approval window is preserved for all callers.
    • Config surface unchanged (no schema, defaults, doctor migrations, or docs/reference/config).
    • Plugin surface unchanged (no plugin SDK, manifest, extensions/api.ts, registry/loader).
    • Gateway protocol unchanged.

Reproduction

  1. Configure Skill Workshop with default approvalPolicy: pending.
  2. Start a Codex agent session and prompt it to apply a pending skill proposal.
  3. The agent invokes skill_workshop(action="apply", proposal_id="...").
  4. Before this PR: the Codex dynamic-tool watchdog fires at 90s with "OpenClaw dynamic tool call timed out after 90000ms while running tool skill_workshop"; the approval prompt is never shown; the proposal stays pending.
  5. After this PR: the 150s Codex deadline lets the approval flow reach its natural 120s expiry; if the operator does not respond the approval times out with a clean denial; if the operator responds the apply proceeds normally.

Real behavior proof

Behavior addressed (#91266): skill_workshop calls from a Codex agent session or /btw side thread no longer surface a generic 90s dynamic-tool timeout. All skill_workshop actions receive the 150s window regardless of action name, because before_tool_call hooks can escalate any action to a lifecycle call after the timeout is resolved.

Real environment tested (Linux, Node 22 — Vitest with fake timers against handleDynamicToolCallWithTimeout, resolveDynamicToolCallTimeoutMs, and resolveSideDynamicToolCallTimeoutMs): unit tests verify the resolver returns 150s for apply/reject/quarantine/list/inspect on both paths; fake-timer tests confirm the 90s watchdog fires on a never-resolving call (before) and a 120s approval completes within the 150s deadline (after).

Exact steps or command run after this patch: node scripts/run-vitest.mjs extensions/codex/src/app-server/dynamic-tool-execution.test.ts extensions/codex/src/app-server/side-question.test.ts

Evidence after fix:

 Test Files  2 passed (2)
      Tests  40 passed (40)

Observed result after fix: resolver returns 150s for all skill_workshop action types on both the main-thread and /btw side-thread paths; the before test confirms the 90s watchdog fires while approval is pending; the after test confirms a full 120s approval completes successfully within the 150s window.

What was not tested: live Gateway + Codex agent session with an active operator approval prompt in the UI.

Repro confirmation: the before test fails if timeoutMs is raised to 150_000 (approval would complete); the after test fails if timeoutMs is lowered to 90_000 (watchdog fires at 90s before the 120s approval).

Risk / Mitigation

  • Risk: All skill_workshop calls receive the 150s deadline, including non-lifecycle calls. Mitigation: non-lifecycle calls (list, inspect) complete in milliseconds; the wider window has no observable runtime effect. The unconditional match is required because before_tool_call hooks can escalate any action to a lifecycle call after the timeout has already been resolved.

Change Type (select all)

  • Bug fix

Scope (select all touched areas)

  • Agent runtime
  • Codex extension

Linked Issue/PR

Fixes #91266

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XS labels Jun 8, 2026
@clawsweeper

clawsweeper Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 21, 2026, 12:34 PM ET / 16:34 UTC.

Summary
The branch raises Codex main-thread and /btw side-thread skill_workshop dynamic-tool timeouts to 150s and adds resolver coverage for those paths.

PR surface: Source +11, Tests +35. Total +46 across 4 files.

Reproducibility: yes. at source level: current main and v2026.6.9 route default Skill Workshop lifecycle approval through a 120s wait plus 10s grace while Codex dynamic-tool calls still use a 90s watchdog. I did not run a live Gateway/Codex approval session in this read-only review.

Review metrics: 1 noteworthy metric.

  • Dynamic-tool timeout defaults: 2 changed: main and side skill_workshop watchdogs 90s -> 150s. This is the merge-relevant availability tradeoff that focused tests do not decide for maintainers.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #91266
Summary: This PR is the candidate fix for the narrow Codex watchdog-vs-Skill-Workshop-approval timeout report; related large-approval-window work partially overlaps but does not safely supersede it.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🌊 off-meta tidepool
Patch quality: 🦞 diamond lobster
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Run a live Gateway plus Codex Skill Workshop approval smoke if maintainers want end-to-end prompt-path proof before landing.

Mantis proof suggestion
A live visual or log proof of the Codex/Gateway approval wait would materially help maintainer confidence, and no dedicated transport lane fits this behavior. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis visual task: verify skill_workshop apply from a Codex agent waits past 90s and reaches the approval result without a generic dynamic-tool timeout, with private details redacted.

Risk before merge

Maintainer options:

  1. Accept the bounded longer watchdog (recommended)
    Merge after final checks if maintainers accept that only Codex skill_workshop dynamic-tool calls can now wait up to 150s so the current approval path can finish cleanly.
  2. Ask for live approval smoke first
    Require a live Gateway plus Codex Skill Workshop approval run if maintainers want end-to-end prompt-path proof beyond resolver and fake-timer tests.
  3. Pause for broader timeout policy
    Pause this PR only if maintainers want to redesign Skill Workshop approval TTLs or establish a shared timeout contract before changing Codex's watchdog.

Next step before merge

  • Maintainers should decide whether to accept the bounded 150s watchdog tradeoff and whether to request optional live smoke; no automated repair is indicated.

Security
Cleared: The diff only changes Codex timeout constants/resolvers and tests, preserves Skill Workshop pending approval, and touches no dependencies, workflows, credentials, permissions, or package metadata.

Review details

Best possible solution:

Land the focused 150s skill_workshop watchdog alignment if maintainers accept the bounded availability tradeoff, while keeping longer approval-window policy in the linked follow-up cluster.

Do we have a high-confidence way to reproduce the issue?

Yes at source level: current main and v2026.6.9 route default Skill Workshop lifecycle approval through a 120s wait plus 10s grace while Codex dynamic-tool calls still use a 90s watchdog. I did not run a live Gateway/Codex approval session in this read-only review.

Is this the best way to solve the issue?

Yes for the narrow reported bug: selecting a skill_workshop timeout before the wrapped tool runs covers direct lifecycle calls and hook-adjusted calls without changing approval policy. A longer approval TTL remains a separate product/security decision in the adjacent follow-up items.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against c2ee9b0be8ae.

Label changes

Label justifications:

  • P2: This is a bounded Codex Skill Workshop bug fix with an open linked issue and limited blast radius.
  • merge-risk: 🚨 availability: The diff intentionally raises the maximum blocked skill_workshop dynamic-tool wait from 90s to 150s on both Codex paths.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The external contributor proof gate does not apply because the PR author association is MEMBER; the PR body includes resolver and fake-timer evidence but no live Gateway approval smoke.
Evidence reviewed

PR surface:

Source +11, Tests +35. Total +46 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 11 0 +11
Tests 2 35 0 +35
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 46 0 +46

What I checked:

Likely related people:

  • steipete: Recent history shows multiple commits on Codex dynamic-tool execution and terminal behavior in the app-server path that owns this watchdog. (role: recent Codex dynamic-tool contributor; confidence: high; commits: a09f6b1b2787, 7139f473332f, 1e82263492cf; files: extensions/codex/src/app-server/dynamic-tool-execution.ts, extensions/codex/src/app-server/side-question.ts)
  • shakkernerd: Feature history shows the Skill Workshop runtime policy and skill_workshop agent-tool rename introduced the lifecycle approval behavior involved in this timeout mismatch. (role: Skill Workshop policy introducer; confidence: high; commits: 3037646d228d, 2383cfd3039d; files: src/skills/workshop/policy.ts, src/skills/workshop/config.ts, src/agents/agent-tools.before-tool-call.ts)
  • joshavant: The async before_tool_call.requireApproval and plugin approval timeout framework used by Skill Workshop approvals were introduced in this history. (role: approval framework contributor; confidence: high; commits: 6ade9c474cf1; files: src/infra/plugin-approvals.ts, src/gateway/server-methods/plugin-approval.ts, src/agents/agent-tools.before-tool-call.ts)
  • udaymanish6: The side-question path's generic dynamic-tool timeout was raised to the current 90s behavior in this contributor's adjacent Codex timeout commit. (role: adjacent Codex timeout contributor; confidence: medium; commits: 0f18d52f16e3; files: extensions/codex/src/app-server/side-question.ts, extensions/codex/src/app-server/side-question.test.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jun 8, 2026
@openperf
openperf force-pushed the fix/91266-skill-workshop-approval-timeout branch from 06e9a31 to ed0a198 Compare June 8, 2026 05:43
@openclaw-barnacle openclaw-barnacle Bot added extensions: codex and removed agents Agent runtime and tooling labels Jun 8, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jun 8, 2026
@openperf
openperf force-pushed the fix/91266-skill-workshop-approval-timeout branch from ed0a198 to 7ebb723 Compare June 8, 2026 05:57
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. label Jun 8, 2026
@openperf
openperf force-pushed the fix/91266-skill-workshop-approval-timeout branch 2 times, most recently from 32aae0f to 787f9b4 Compare June 8, 2026 06:33
@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Jun 8, 2026
@openperf
openperf force-pushed the fix/91266-skill-workshop-approval-timeout branch from 787f9b4 to c477695 Compare June 8, 2026 06:50
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Jun 8, 2026
@openperf
openperf force-pushed the fix/91266-skill-workshop-approval-timeout branch from c477695 to 9ff0cfc Compare June 8, 2026 07:01
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jun 8, 2026
@openperf
openperf force-pushed the fix/91266-skill-workshop-approval-timeout branch from 9ff0cfc to 3d5b04e Compare June 8, 2026 07:20
@openperf openperf changed the title fix(skill-workshop): bound lifecycle approval timeout below Codex dynamic-tool watchdog fix(codex): extend skill_workshop dynamic-tool timeout above approval ceiling Jun 8, 2026
@openperf
openperf force-pushed the fix/91266-skill-workshop-approval-timeout branch from 3d5b04e to 2182083 Compare June 8, 2026 12:19
…approvals

skill_workshop lifecycle approvals (apply/reject/quarantine) require up to
120s plus 10s gateway grace (130s total), but the generic Codex dynamic-tool
watchdog fires at 90s. The watchdog fired first with a generic timeout error,
leaving the approval pending and the proposal unmodified.

Add a 150s per-tool deadline for skill_workshop in readConfiguredDynamicToolTimeoutMs,
matching the pattern used for message and image tools. The approval can now
complete or expire cleanly before the Codex watchdog fires; non-Codex callers
keep the unchanged 120s approval window.

Fixes openclaw#91266
@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Jul 15, 2026
@openclaw-barnacle

Copy link
Copy Markdown

Closing due to inactivity.
If you believe this PR should be revived, post in #clawtributors on Discord to talk to a maintainer.
That channel is the escape hatch for high-quality PRs that get auto-closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: codex merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS stale Marked as stale due to inactivity status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Skill Workshop agent-tool apply times out because approval wait exceeds tool watchdog

1 participant