Skip to content

feat(jobs): add wait_for_job tool for background jobs#390

Merged
esengine merged 1 commit intoesengine:mainfrom
ctharvey:wait-for-job
May 7, 2026
Merged

feat(jobs): add wait_for_job tool for background jobs#390
esengine merged 1 commit intoesengine:mainfrom
ctharvey:wait-for-job

Conversation

@ctharvey
Copy link
Copy Markdown
Contributor

@ctharvey ctharvey commented May 7, 2026

Summary

  • add a narrow wait_for_job(jobId, timeoutMs) shell tool instead of a generic wait primitive
  • teach JobRegistry to block until a job exits or emits fresh output and return the latest delta
  • cover the new behavior with job-registry and shell-tool tests

Testing

pm exec vitest run tests/jobs.test.ts tests/shell-tools.test.ts

pm run typecheck (fails on current upstream Ink/type drift in src/cli/commands/chat.tsx, src/cli/ui/layout/CardStream.tsx, and src/cli/ui/ticker.tsx, unchanged here)

Notes

Copy link
Copy Markdown
Owner

@esengine esengine left a comment

Choose a reason for hiding this comment

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

Companion PR matches the maintainer guidance shape — wait_for_job is the single tool that replaces N polling iterations, riding the existing job registry's exit + output events. Nice touch returning the latest-output delta rather than the full buffer. Thanks for the clean follow-up.

@esengine esengine merged commit 15b4060 into esengine:main May 7, 2026
3 checks passed
@esengine esengine mentioned this pull request May 7, 2026
5 tasks
esengine added a commit that referenced this pull request May 7, 2026
Three contributor-led follow-ups: storm guard exempts safe inspector
reads (#388 by @ctharvey), wait_for_job replaces polling loops with
one blocking call (#390 by @ctharvey), and /skill new finally
provides the missing scaffold for user skills (#394).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants