Skip to content

fix(lobster): don't route schema-default flowExpectedRevision into TaskFlow (#102011)#102022

Closed
ObliviateRickLin wants to merge 1 commit into
openclaw:mainfrom
ObliviateRickLin:fix/lobster-schema-default-flow-revision-102011
Closed

fix(lobster): don't route schema-default flowExpectedRevision into TaskFlow (#102011)#102022
ObliviateRickLin wants to merge 1 commit into
openclaw:mainfrom
ObliviateRickLin:fix/lobster-schema-default-flow-revision-102011

Conversation

@ObliviateRickLin

@ObliviateRickLin ObliviateRickLin commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Closes #102011

What Problem This Solves

Fixes an issue where ordinary @openclaw/lobster tool run / resume calls
fail by being misrouted into managed TaskFlow mode. When the tool schema supplies
default flow fields for a minimal call — flowExpectedRevision (e.g. 0) or an
empty flowStateJson — the wrapper treated those always-present values as a
managed-flow signal, so an ordinary resume errored with flowId required when using managed TaskFlow resume mode and an ordinary run with flowControllerId required when using managed TaskFlow run mode / run action does not accept flowId or flowExpectedRevision. The standalone Lobster CLI handled the same
workflow correctly, confirming the fault is in the OpenClaw plugin wrapper.

Why This Change Was Made

Managed TaskFlow mode is identified only by its intentional flow identifiers —
flowId for resume, flowControllerId/flowGoal for run. Secondary fields
(flowExpectedRevision, flowStateJson, and the step fields), which the tool
schema can inject as defaults, no longer select managed mode on their own. Real
managed flows are unchanged: managed resume still requires
flowExpectedRevision, and managed run still needs flowControllerId/flowGoal.

User Impact

The documented minimal run / resume Lobster tool calls work again; ordinary
approval workflows no longer fail with a spurious managed-TaskFlow error.

Evidence

Real behavior proof — drove the actual createLobsterTool with the real
embedded @clawdbot/lobster runtime
executing the issue's approval-smoke
workflow, passing the schema-injected defaults (flowExpectedRevision: 0,
flowStateJson: "{}") on the minimal run, then resume with the returned
token:

BEFORE (current source): the ordinary run is misrouted into managed mode and the
  real lobster runtime call fails with:
    Error: flowControllerId required when using managed TaskFlow run mode
AFTER (this PR): run → needs_approval (real resumeToken), then resume → ok.
  The full run→approval→resume completes through the real runtime.

(Ran via a temporary *.test.ts using createEmbeddedLobsterRunner(); captured
the before/after by toggling the source with git stash. Not committed.)

Regression tests in extensions/lobster/src/lobster-tool.test.ts (colocated,
run the real createLobsterTool):

  • ordinary resume carrying only a schema-default flowExpectedRevision runs as
    an ordinary resume instead of erroring;
  • ordinary run carrying only a schema-default flowStateJson runs as an
    ordinary run instead of erroring;
  • managed run with an injected flowExpectedRevision: 0 is still accepted.

Full suite passes (20 tests) via node scripts/run-vitest.mjs run extensions/lobster/src/lobster-tool.test.ts. oxfmt/oxlint clean.


AI-assisted: written with Claude Code. The before/after evidence is from running
the real lobster runtime locally, not AI-generated assertions taken on faith.

@clawsweeper

clawsweeper Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 8, 2026, 1:39 AM ET / 05:39 UTC.

Summary
The PR updates the Lobster tool parser and colocated tests so schema-default flow fields do not route ordinary run/resume calls into managed TaskFlow mode.

PR surface: Source +3, Tests +90. Total +93 across 2 files.

Reproducibility: yes. source-level. Current main and v2026.6.11 can route ordinary Lobster run/resume into managed parsing when injected default flow fields are present; I did not execute a live Gateway reproduction in this read-only review.

Review metrics: 1 noteworthy metric.

  • Schema-default routing: 2 default flow fields handled. The PR changes how flowStateJson and flowExpectedRevision affect ordinary versus managed Lobster execution.

Stored data model
Persistent data-model change detected: serialized state: extensions/lobster/src/lobster-tool.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #102011
Summary: This PR is a focused candidate fix for the canonical Lobster schema-default flow-field misrouting issue; another open PR targets the same issue and one weaker candidate was already closed.

Members:

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

Merge readiness
Overall: 🦞 diamond lobster
Proof: 🦞 diamond lobster
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.

Risk before merge

  • [P1] A sibling candidate PR remains open for the same canonical Lobster parser issue, so maintainers should land only one fix and close the duplicate after merge.

Maintainer options:

  1. Decide the mitigation before merge
    Land one focused Lobster parser fix, with this PR as a clean candidate, then close the canonical issue and duplicate candidate PRs after the merge.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • No ClawSweeper repair job is needed; this PR has no blocking findings and should proceed through normal maintainer merge review.

Security
Cleared: The diff is limited to Lobster parser logic and colocated tests, with no dependency, lockfile, CI, secret, permission, install, or supply-chain surface change.

Review details

Best possible solution:

Land one focused Lobster parser fix, with this PR as a clean candidate, then close the canonical issue and duplicate candidate PRs after the merge.

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

Yes, source-level. Current main and v2026.6.11 can route ordinary Lobster run/resume into managed parsing when injected default flow fields are present; I did not execute a live Gateway reproduction in this read-only review.

Is this the best way to solve the issue?

Yes. A plugin-local parser fix is the narrowest maintainable solution because docs and runtime already define ordinary and managed modes, and no core API or Lobster runtime change is needed.

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body and follow-up comments include before/after terminal output from the actual createLobsterTool path using the real embedded @clawdbot/lobster runtime, plus focused regression tests.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body and follow-up comments include before/after terminal output from the actual createLobsterTool path using the real embedded @clawdbot/lobster runtime, plus focused regression tests.

Label justifications:

  • P2: The PR targets a normal-priority shipped Lobster plugin approval workflow bug with limited plugin-local blast radius.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body and follow-up comments include before/after terminal output from the actual createLobsterTool path using the real embedded @clawdbot/lobster runtime, plus focused regression tests.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body and follow-up comments include before/after terminal output from the actual createLobsterTool path using the real embedded @clawdbot/lobster runtime, plus focused regression tests.
Evidence reviewed

PR surface:

Source +3, Tests +90. Total +93 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 23 20 +3
Tests 1 90 0 +90
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 113 20 +93

What I checked:

Likely related people:

  • mbelinky: Authored the merged managed TaskFlow mode and follow-up Lobster hardening PRs that added and shaped the parser branch involved here. (role: introduced behavior and feature-history owner; confidence: high; commits: 30dc24fbd8be, b167df78aa17; files: extensions/lobster/src/lobster-tool.ts, extensions/lobster/src/lobster-tool.test.ts, extensions/lobster/src/lobster-taskflow.ts)
  • steipete: Recent history shows Lobster managed-flow formatting and tool-handling refactors near the same parser and TaskFlow result surface. (role: adjacent refactor contributor; confidence: medium; commits: 3700f3a22cd1, 95df6d933282; files: extensions/lobster/src/lobster-tool.ts, extensions/lobster/src/lobster-taskflow.ts)
  • kirkluokun: Authored the approvalId/resume-token change in the same Lobster approval resume path. (role: adjacent resume contributor; confidence: medium; commits: 75fc8b704027; files: extensions/lobster/src/lobster-tool.ts, extensions/lobster/src/lobster-runner.ts, extensions/lobster/src/lobster-taskflow.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.
Review history (3 earlier review cycles)
  • reviewed 2026-07-08T04:50:45.590Z sha 863643b :: needs real behavior proof before merge. :: [P2] Treat default flowStateJson as absent for ordinary run
  • reviewed 2026-07-08T05:13:28.959Z sha 987309a :: needs changes before merge. :: [P2] Treat blank flowStateJson as absent before parsing
  • reviewed 2026-07-08T05:32:25.416Z sha 4ab0876 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Jul 8, 2026
@ObliviateRickLin
ObliviateRickLin force-pushed the fix/lobster-schema-default-flow-revision-102011 branch from 863643b to 987309a Compare July 8, 2026 05:06
@ObliviateRickLin

Copy link
Copy Markdown
Contributor Author

Addressed the review:

  • Completed the run-side fix. Managed mode is now keyed only on the intentional flow identifiers — flowId for resume, flowControllerId/flowGoal for run — so a schema-injected flowStateJson (or step fields) no longer selects managed run parsing. Added a regression test for the empty-flowStateJson ordinary-run case.
  • Added real behavior proof. Ran the actual createLobsterTool with the real embedded @clawdbot/lobster runtime on the issue's approval-smoke workflow, with the schema-injected defaults present. Before the patch the ordinary run fails with flowControllerId required when using managed TaskFlow run mode; after the patch run → needs_approval → resume completes through the real runtime. Details in the updated PR body.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 8, 2026
…penclaw#102011)

Ordinary lobster run/resume calls were misrouted into managed TaskFlow mode when
the tool schema injected default flow fields (e.g. flowExpectedRevision=0, an
empty flowStateJson): resume failed with "flowId required when using managed
TaskFlow resume mode" and run with "flowControllerId required..." /
"run action does not accept flowId or flowExpectedRevision".

Managed mode is identified only by its intentional flow identifiers — flowId for
resume, flowControllerId/flowGoal for run. Secondary fields
(flowExpectedRevision, flowStateJson, step fields) that the schema can inject as
defaults no longer select managed mode. Real managed flows are unchanged
(managed resume still requires flowExpectedRevision; managed run still needs
flowControllerId/flowGoal).

Co-Authored-By: Claude Fable 5 <[email protected]>
@ObliviateRickLin
ObliviateRickLin force-pushed the fix/lobster-schema-default-flow-revision-102011 branch from 987309a to 4ab0876 Compare July 8, 2026 05:22
@clawsweeper clawsweeper Bot removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jul 8, 2026
@ObliviateRickLin

Copy link
Copy Markdown
Contributor Author

Addressed the re-review finding (P2):

  • Blank flowStateJson now normalized before parsing. parseOptionalFlowStateJson treats a blank/whitespace flowStateJson (the actual schema default) as absent, so an ordinary run with flowStateJson: "" no longer fails with flowStateJson must be valid JSON before reaching the ordinary-run path. Managed mode stays keyed on flowControllerId/flowGoal (run) and flowId (resume).
  • Regression coverage now parametrized over both schema-default shapes — flowStateJson: "" and "{}" — with flowExpectedRevision: 0. Verified before/after: on current source the "" case fails with flowStateJson must be valid JSON; with the patch the full suite passes (21 tests).

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jul 8, 2026
@vincentkoc vincentkoc self-assigned this Jul 8, 2026
@vincentkoc

Copy link
Copy Markdown
Member

Closing as superseded by #102036, merged in 8cb9263.

The canonical fix includes the valid schema-default routing insight from this PR, and also handles blank/empty flow state, preserves explicit managed stateJson: {}, and rejects incompatible cross-mode fields before fallback. Thanks @ObliviateRickLin for the contribution and real-runtime proof work.

@vincentkoc vincentkoc closed this Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: lobster Extension: lobster P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: S 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.

@openclaw/lobster tool run/resume misroutes schema default flowExpectedRevision into TaskFlow mode

2 participants