Skip to content

chore(core): revert niche fixes from the daily review job - #66140

Merged
vimtor merged 10 commits into
devfrom
revert-niche-fixes
Nov 24, 2026
Merged

vimtor merged 10 commits into
devfrom
revert-niche-fixes

Conversation

@vimtor

@vimtor vimtor commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

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

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 own setup hangs, 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 check passes.
  • Core suite: 8034 pass, 39 skip, 3 fail. The 3 failures are the macOS Bash 3.2 shell tests (tool-shell.test.ts, shell-scan/compound-parity.test.ts), which fail the same way on dev.
  • packages/plugin, packages/sdk/test/instances.test.ts and packages/tui/test/component/dialog-speed.test.tsx pass.

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)

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread packages/core/src/plugin/host.ts Outdated
Effect.provideService(Instance.Service, instances),
),
Effect.gen(function* () {
if (yield* plugin.activating)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@vimtor
vimtor force-pushed the revert-niche-fixes branch from d4c6426 to b9ed0cf Compare November 24, 2026 16:26

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@vimtor
vimtor merged commit 9964772 into dev Nov 24, 2026
14 checks passed
@vimtor
vimtor deleted the revert-niche-fixes branch November 24, 2026 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant