Repository navigation
feat(core): deliver background job notices from the job service - #60705
Open
kitlangton wants to merge 1 commit into
Open
kitlangton wants to merge 1 commit into
kitlangton wants to merge 1 commit into
Conversation
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.
Background job completion notices now deliver from the global job service instead of plugin-scoped fibers.
Previously each tool forked its own
notifyWhenDonefiber inside a location-scoped plugin, so reloading or closing a location mid-run could orphan notice delivery. Centralizing delivery inJobkeeps background runs alive until the notice reaches the session inbox.💡 Why
Deferredplumbing besideJob.start.🆕 Now you can
sessionID,output(live partial output reader),stop, and{ output, value }toJob.start, withSessionregistering a single global notifier viaJob.registerNotifier.Job.readandJob.list, and cancel silently withJob.cancel(id, { notify: false }).📊 Numbers
Jobscope delivers noticeJob.startDeferredper callerRunOutput<Value>onInfoTests: 53 pass across
job.test.tsandsession-execution.test.ts.👀 Read:
packages/core/src/job.tsarounddeliverNoticeandautoNotify: auto-delivery activates only when callers opt in withsessionIDonJob.start, keeping existing callers (ShellTool,ImageGenerateTool) duplicate-free until their follow-up PRs dropnotifyWhenDone. The rest is routine.🔍 Split 2 of 6 from #60495 · stacked on #60704
Checks run
bun run --cwd packages/core typecheckbun --cwd packages/core test test/job.test.ts test/session-execution.test.ts: 53 pass