feat: Add optional lobster plugin tool (typed workflows, approvals/resume) #1152
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a new plugin extension
extensions/lobster/that registers a lobster agent tool as an optional (opt‑in) plugin tool. Implemented as an optional plugin tool using the new boundary. If we hit a limitation in practice, happy to propose a minimal boundary extension PR.Lobster lets Clawdbot run deterministic, typed workflows (pipelines) as a single tool call, with resumable approvals for side effects. This reduces token usage and brittleness by moving step-by-step tool orchestration out of the LLM, while keeping Clawdbot core unchanged.
Conceptually, Lobster is “bash pipes for tools”, but typed and safe: tool outputs stay structured, workflows are composable, and any side effect is gated behind an approval token that can be resumed. This is how we can do workflows like “triage email → draft replies → ask approval → send” as one call instead of a long sequence of tool calls.
Why plugin (not core)
• Keeps Clawdbot core slim and avoids adding a new runtime/language until it proves useful.
• Uses the newly added optional plugin tools boundary (commit 6da6582).
• If Lobster earns trust and stabilizes, we can consider deeper integration later, but this keeps the initial footprint minimal and reversible.
Opt-in / Allowlist
This tool is registered with
{ optional: true }and is never enabled automatically.Users must enable it via
agents.list[].tools.allow, e.g.:•
"lobster"(plugin id, enables all tools from this plugin), or•
"group:plugins"(enables all plugin tools)Security / Safety
• Local-only subprocess execution; no new network surface.
• Lobster does not manage OAuth/tokens/secrets.
• Hardening: • lobsterPath must be absolute if provided (reduces PATH hijack risk).
• timeoutMs and maxStdoutBytes caps.
• Strict JSON envelope parsing (rejects invalid output).
• Sandbox safety: • The tool factory returns null when
ctx.sandboxedis true (tool not available in sandboxed contexts).What’s included
• extensions/lobster/ extension plugin
• lobster tool implementation + tests
• README describing enablement + security notes
Tests run
• pnpm vitest run extensions/lobster/src/lobster-tool.test.ts
• pnpm vitest run src/agents/pi-tools.create-clawdbot-coding-tools.adds-claude-style-aliases-schemas-without-dropping-b.test.ts -t "preserves action enums"
AI-assisted
This PR was AI-assisted. I’ve run the tests above and I understand the subprocess/security boundaries.