Repository navigation
chore(core): revert niche fixes from the daily review job - #66140
Conversation
There was a problem hiding this comment.
The reverts are faithful and the replacement check works as described. I checked that nothing still uses the removed pieces and ran the closest tests in core (automation, models, worktree), sdk (instances) and tui (dialog-speed): all pass, and tsc passes in core, plugin, sdk and tui. The new test is small and deterministic. I also checked that the check keeps the no-deadlock guarantee: a host plugin creating an automation for a session in a booting SDK instance just waits for that build, and a plugin inside the instance gets refused.
Public API: in the experimental plugin API, ctx.experimental.automation.create now fails with Automation.InvalidError for any automation, prompt automations included, while the calling plugin's registry is activating. A plugin that created a prompt automation during setup now gets an error and has to move the call to an event handler. The reverted Promise-adapter change brings back the earlier rejection shape for calls aborted mid-call. Plugin.Interface.activated becomes activating; that interface is internal to core. There are no config, CLI, HTTP or SDK surface changes.
One behaviour note is inline: the refusal also happens while any plugin in the registry is reloading, not only during the caller's own setup.
| Effect.provideService(Instance.Service, instances), | ||
| ), | ||
| Effect.gen(function* () { | ||
| if (yield* plugin.activating) |
There was a problem hiding this comment.
activating is pending.size > 0, and pending also counts the supervisor's registry.hold() while it reloads a changed plugin. So a plugin that's already running and creates an automation from an event handler (the path the error message recommends) also gets "Plugins are still loading" whenever another plugin in the same registry is reloading. Before the automation stack, that create waited for the reload. #66109 already refused code/shell creates in this case, but prompt creates now fail too. If that's intended, it may be worth wording the error so it doesn't read as the caller's own setup. Otherwise, the check could be limited to the caller's own setup, for example a flag that's only set while plugin.effect(host) is running.
d4c6426 to
b9ed0cf
Compare
There was a problem hiding this comment.
Thread 1 is resolved: the activating check and its "Plugins are still loading" error are gone, so creates made while another plugin reloads behave as they did before #65987. The PR is now only the ten revert commits. The core automation, models and worktree tests pass, as do sdk instances.test.ts and core typecheck:tsc.
Public API: the experimental plugin API goes back to how it was before #65987. A plugin that awaits a code or subagent automation create inside its own setup hangs again, as the description says. Promise plugin calls aborted mid-call go back to the earlier rejection shape. Plugin.Interface.activated is removed; it only existed since this chain and is internal to core. Config, CLI, HTTP and SDK are unchanged.
No new concerns.
Reverts several fixes from Nov 24 that handle very narrow cases at a cost to core that isn't worth it. Most came from the daily review job, and several were fixing problems that an earlier fix in the same chain had introduced. This PR only reverts; it adds no new code.
Reverted
priorityandfast, which are the same tier at the same price, and that belongs in models.dev. fix(core): keep saved Superbot Fast Priority sessions working #66106 then hardcoded asuperbot-ggalias into the core model lookup, the session runner and the TUI. It only helped sessions saved under the experimentalmodel_speedsflag during the day between feat: offer a model's service tiers as a speed in the TUI and desktop #65749 and fix(core): keep a mode's ID on the service tier it asks for #65989.builtinGitfield on the strategy state to cover a very short window.AutomationCode.FromPlugin,awaitPlugins,inSession,Plugin.activated, and an SDK instance selector that serves its own entry while it boots.What comes back
The automation behavior returns to what it was before #65987, in the experimental plugin API (
ctx.experimental.automation.create). A plugin that awaits a code or subagent-prompt automation create inside its ownsetuphangs, and so does a shell or subagent create for an SDK instance's own Session during that instance's boot. Creating automations from an event handler or after setup works. Plain prompt-to-session creates during setup work too.Verification
bun run checkpasses.tool-shell.test.ts,shell-scan/compound-parity.test.ts), which fail the same way ondev.packages/plugin,packages/sdk/test/instances.test.tsandpackages/tui/test/component/dialog-speed.test.tsxpass.No flag: this only removes code.
Added by the opencode bot (AI-generated).
Public API: experimental plugin API returns to its behavior before #65987 (automation creates awaited during setup can hang again; aborted Promise plugin calls use the earlier rejection shape)