Repository navigation
fix(lobster): keep rejected approvals cancelled and enforce output limits - #130259
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Closing to retrigger CI (check-lint/ci-gate failed due to a runner shutdown/infra flake, not code issues). |
|
Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 9:51 PM ET / August 27, 2026, 01:51 UTC. ClawSweeper reviewWhat this changesThe PR preserves cancelled Lobster approval outcomes in managed flows and rejects oversized result envelopes returned directly by the embedded Lobster runtime. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readinessThe PR remains necessary: current main still finishes a cancelled Lobster envelope as a successful managed flow. The patch moves that terminal decision to the owner-scoped TaskFlow cancellation authority and adds focused coverage; no blocking defect was found. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherThe optional Lobster plugin converts embedded workflow-runtime envelopes into OpenClaw tool results. Managed requests additionally update a session-owned TaskFlow, while embedded responses bypass stdout/stderr streams and must be bounded before returning to the agent. flowchart TD
A[Agent tool request] --> B[Lobster plugin]
B --> C[Embedded workflow runtime]
C --> D[Result envelope]
D --> E{Managed flow request?}
E -->|Yes| F[Session-owned TaskFlow]
E -->|No| G[Bounded tool result]
F --> G
Before merge
Agent review detailsSecurityNone. PR surfaceSource +64, Tests +101. Total +165 across 5 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the focused plugin-owner repair after the normal exact-head merge gates pass, retaining TaskFlow as the sole authority for managed cancellation and the embedded-return boundary as the output-cap owner. Do we have a high-confidence way to reproduce the issue? Yes. Current main source proves that cancelled envelopes reach generic completion, and the PR body supplies a reproducible before/after run through the real TaskFlow runtime with the persisted status observed. Is this the best way to solve the issue? Yes. The adapter now delegates cancellation to the existing session-scoped TaskFlow authority; changing stdout sinks alone cannot bound an embedded result returned directly from the runtime. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 4e92ea645a89. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
Co-authored-by: Nonosword <[email protected]>
b4ccb95 to
1bbb034
Compare
|
Thanks @Nonosword! Proof: A real approval-gated workflow from the pinned Lobster runtime moved its production TaskFlow record from
Example
|
…w#130259) Keep managed Lobster state aligned with rejected approvals and enforce the configured byte limit on the JSON returned to the model. Co-authored-by: Nonosword <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
Rejecting a Lobster approval returns a successful
cancelledenvelope. The managed-flow adapter treated every successful non-waiting envelope as complete, so the authoritative TaskFlow record becamesucceeded.Embedded Lobster calls also returned structured output outside the bounded stdout and stderr streams. A model-visible JSON result could exceed
maxStdoutBytes.Why This Change Was Made
The shared run and resume path now sends
cancelledenvelopes to the session-bound TaskFlow cancellation authority. It never sends that outcome to generic completion. If cancellation cannot settle or rejects, the adapter returns an error without changing the flow tosucceededorfailed.All embedded run, workflow-file, and resume results now pass through one normalization point. That point measures the same pretty JSON form returned to the model and rejects it when it exceeds the configured limit.
User Impact
Rejected Lobster approvals now leave their managed TaskFlow records
cancelled. Oversized embedded results now fail withlobster runtime result exceeded maxStdoutBytesinstead of bypassing the output cap.Evidence
The live check used the pinned Lobster runtime to execute a real approval-gated workflow and the production session-bound TaskFlow runtime to inspect persisted state. It ran the same inputs against exact main
8d51e415d6a14ae7b6d1023fc9661e4bc1e9c725and head1bbb034e2bfa8a288a8de10cce005d39e3c9da45.waitingsucceededcancellednode scripts/run-vitest.mjs extensions/lobster: 73 tests passed.pnpm build: passed on the exact head in an isolated Linux checkout.pnpm check:changed: passed on the exact head, including extension production types, test types, lint, formatting, contract tests, dead exports, database-first checks, and import-cycle checks.node scripts/check-docs-mdx.mjs docs/tools/lobster.md: passed.node scripts/docs-link-audit.mjs docs/tools/lobster.md: 6,908 internal links checked, 0 broken.Co-authored-by: Nonosword [email protected]