feat(sdk,surface): plugin registry — flows add helper-<name> (#305) - #336
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
72eb9a9 to
512e31e
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 512e31e. Configure here.
| } | ||
| const receipt = await readCompletedStepOutput(journal, outcome.run_id, id, journalSteps) as { output: unknown }; | ||
| return receipt.output; | ||
| }), deadline]); |
There was a problem hiding this comment.
Deadline race abandons plugin execution
High Severity
The 30s dispatch timer starts at the beginning of runPluginEffect and is raced against budget.execute. When a flow has a budget, that wait includes the serialized queue behind other budgeted steps, so a concurrent f.agent/f.llm/f.run longer than 30s can fail the plugin with a spurious dispatch timeout. Winning the race also abandons the still-running budget.execute promise, which later rejects without a handler after run.start settles.
Reviewed by Cursor Bugbot for commit 512e31e. Configure here.
| } | ||
| const plugin = readPlugin(join(root, 'node_modules', packageName), packageName); | ||
| await probePlugin(plugin); | ||
| if (!existsSync(join(plugin.directory, 'src/index.js'))) throw new PluginError('plugin_manifest_invalid', 'Plugin requires src/index.js.'); |
There was a problem hiding this comment.
Failed add blocks later flow runs
Medium Severity
flows add runs npm install before manifest validation and credential/server probes, and it does not roll back on failure. loadPlugins then treats any leftover @flows/helper-* in node_modules as plugin_unlisted. A refused add (missing credentials, bad manifest, unreachable server) leaves every later TypeScript flows check and flows run failing until the package is removed by hand.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 512e31e. Configure here.
maintainability lens — PASSMaintainability review — PR #336 (plugin registry slice)Concerns1. 2. Fall-through after 3. 4. Brittle npm error classification. 5. Daemon-startup retry loop in the live test ( Notes
No blockers. REVIEW_PASSED |
history lens — PASSBlockers: none under the HISTORY lens. I inspected the supplied diff, recent commit history, repository instructions, RFC decisions, operational records, and PR commit messages. Notes
Concerns, not blockers
This verdict is a history review; I did not rerun tests. REVIEW_PASSED |
structure lens — MISSING |
|
🎯 review-swarm: FAILED (M:pass H:pass S:missing) Lens transcripts posted as sibling comments above. |
Session-Id: 01a09168-b666-7ae2-9f29-0ea10e48b894 Session-Id: 01a091dd-02a2-7820-8006-4430d2a5c76e Session-Id: efeda5df-9b7c-48d4-b2ce-957f5bef0a82
Session-Id: 01a091dd-02a2-7820-8006-4430d2a5c76e Session-Id: efeda5df-9b7c-48d4-b2ce-957f5bef0a82
@flows/helper-* packages installed in node_modules but absent from flows.json plugins now emit plugin_unlisted (plugin-loader.ts). The existing PREFLIGHT_FAILURE_KINDS walker did not have a scenario for this refusal, so PR#336's linux-x64-artifact failed on set parity. Adds a scoped fixture creating an unlisted helper directory and asserts the loader refuses it. Session-Id: efeda5df-9b7c-48d4-b2ce-957f5bef0a82
512e31e to
5656647
Compare


Closes #305. Plugin registry per SURFACE.md §3. Codex agent spec-J-plugin on finn-mini; head 72eb9a9.
🤖 Generated with Claude Code
Note
Medium Risk
Introduces a new authored execution and journal effect path plus npm-driven project mutation; kernel is unchanged but plugin preflight and effect lowering affect run/check behavior for flows using helpers.
Overview
Adds a minimal plugin registry slice so projects can install community helpers with
flows add helper-<name>(npm@flows/helper-*), record them inflows.jsonplugins, and optionally pick upflows-plugin.d.tsforCtxaugmentation.Install & contract:
cli/add.tsruns npm install, validatesflows-plugin.json(verbs, mandatory preflight, JSON Schema args), probes credentials and HTTP(S) HEAD targets, and refuses undeclared@flows/helper-*packages innode_modules. OnlylowersTo: "effect"is supported; triggers, gates, and other primitives fail withplugin_unsupported.Check & run: TypeScript
flows checkloads declared plugins viapluginSearchStart; plugin refusal kinds join the closed preflight taxonomy. The authored executorObject.assigns manifest-driven namespaces ontofand lowers calls throughrunPluginEffect: a short-lived journal worker, agent effect confirm/complete, lease renewal, and a 30s dispatch deadline with child-run cancel on timeout.Docs & tests: SURFACE §3 documents the slice; evidence file captures focused vitest/kernel runs. Offline
testdata/pluginsfixtures back add/load/effect tests.Reviewed by Cursor Bugbot for commit 5656647. Bugbot is set up for automated code reviews on this repo. Configure here.