feat(jobs): add durable async Agent jobs - #81
Merged
Merged
Conversation
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.
Summary
spawn_agentand client callers now create one delegated child session with a Directive, publish its DB ID tochaz_group, and get that ID back as the job handle. An executor validates and runs the published DB; it does not create a second child.The child DB holds job state, claims, and terminal results, which callers can read through
job_statusandjob_wait. Queued jobs recover after restart. Started attempts need explicit retry because their effects may be uncertain. Before execution, the executor checks the hosted Agent/home and inherited tool, grant, and delegation limits. Client-role processes can submit and observe, but cannot execute jobs.V1 limits
Jobs are trusted same-login, broad-local only. The last-writer-wins claim is not fencing: colliding executors can overlap side effects. If submission has an unknown outcome, inspect the catalog rather than creating a replacement job.
job_waitdefaults to 30 seconds (maximum 240). Inside an Agent turn, it holds one of the ten shared executor permits; enough waiting parents can delay queued children until a wait times out. External client observation does not use a permit. Yielding the permit and resuming a waiting parent after restart are deferred.