Skip to content

v0.4.2 — AutoBG: auto-background long tool runs with a 30s countdown

Choose a tag to compare

@engrtarun engrtarun released this 30 Oct 04:09
· 9 commits to main since this release

New feature of this repo: AutoBG — a session whose tool call (bash / scripts / MCP) keeps the foreground blocked longer than 2 minutes is moved to background automatically. Exactly the Ctrl+B operation, exactly when you would have wanted it.

  • No blind moves: one toast at T-30s (AutoBG: 30s — "bash" moves to background automatically) and one on the move (AutoBG: moved to background (ran 2m01s)).
  • Your tool survives: backgrounding never kills tools — that is the engine's own contract; the build keeps running, the foreground stays yours.
  • Tools-only scope: model thinking/writing is never touched — only open tool calls (v1 session.tool.called / v2 session.tool.input.started → success/failed).
  • Guards: subagent children (parentID) and unmapped sessions never fire (#12 guard), one shot per session turn, 10-minute zombie cap for missed end events, exact engine route POST /api/session/{id}/background (falls back from the SDK method when absent).
  • 33-test suite (8 new AutoBG tests incl. two full SSE integration tests).

Update: copy index.ts, lib.ts, autobg.ts, package.json into ~/.config/opencode/plugins/model-badges/ and restart OpenCode.