Repository navigation
Conversation
Add ctx.background.register so plugins can declare external work for a Session. Active tasks appear in SessionIdle.background and /goal waits for them instead of continuing or reporting a stall. Tasks are scoped to the plugin activation and removed when it unloads.
Author
|
The The other checks ( The branch has been updated with |
1 task done
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Issue for this PR
Closes #60860
Type of change
What does this PR do?
Plugins can run work outside a Session, such as remote benchmarks, but the host had no way to know the Session was still waiting.
/goalcould treat the idle Session as stalled, continue unnecessarily, and eventually pause with "Not making progress".Add a host-managed plugin background task registry and expose
ctx.background.register({ sessionID, description }). Active tasks are included inSessionIdle.backgroundas{ kind: "plugin", ... }./goaltreats its own active plugin task like other background work: it stops evaluating until the plugin settles the task and sends a synthetic message. Registering does not wake the Session, so task lifecycle and wake-up stay separate;WAIT_LIMITstill pauses a goal when no wake-up arrives.Tasks are scoped to the plugin activation and removed when it unloads. Completion is idempotent, duplicate ids are rejected per plugin, and task state is process-local rather than persisted across restart.
No feature flag: this is new plugin API surface, and the behavior only applies when a plugin registers a task.
How did you verify your code works?
bun run typecheck:tscinpackages/coreandpackages/pluginbun run checkfrom the repo root: 37/37 packages typecheckbun run testinpackages/core: 8343 pass, 34 skip, 2 failures in existing shell tests caused by macOS bash 3.2.57; both reproduce in isolationbun run testinpackages/plugin: 38 passbun run testinpackages/server: 238 pass, 1 skip/goalwait/resume behaviorScreenshots / recordings
N/A (server-side plugin API)
Checklist