Skip to content

feat(studio): L06a PassRunner queue and spend.jsonl spend log - #1070

Merged
LinuxDevil merged 1 commit into
mainfrom
fb-l06a
Nov 11, 2026
Merged

LinuxDevil merged 1 commit into
mainfrom
fb-l06a

Conversation

@LinuxDevil

Copy link
Copy Markdown
Owner

Summary

  • server/passes/passRunner.ts: in-process PassRunner — FIFO queue, concurrency 2, dedupe by kind:key, 3 attempts with [1000, 4000] backoff, settle-without-retry error classes (PassUnavailableError/PassRefusedError/PassSkippedError/PassOutputError), failure classification, close() aborts running jobs and settles queued ones as skipped.
  • server/passes/spendLog.ts: append-only spend.jsonl at studioPaths().spend (Studio-global) + summarizeSpend.
  • Every settled pass writes exactly one PassRecord (now with workspaceId) and ends one pass.<kind> span on the lazy studio-passes observe reporter.
  • WorkspaceServices.passRunner → WorkspaceContext.passes (one runner per app, shared by every workspace); createApp gains passRunner/spendLog options; startStudioServer builds and closes them.
  • GET /settings/passes/spend?month=YYYY-MM → PassSpendSummary (400 on a bad month).

Test plan

  • npm run test:server --workspace apps/agent-forge — 1358 pass (1 unrelated idleVersions timing flake, passes in isolation)
  • npm run typecheck:server --workspace apps/agent-forge
  • npx fallow audit — clean
  • CI green

Generated with Devin

In-process PassRunner runs background model passes with concurrency 2,
dedupe by kind:key, 3 attempts with backoff, settle-without-retry error
classes, one PassRecord line per pass in the Studio-global spend log,
and one pass.<kind> span on the studio-passes observe reporter. The
spend log lives at studioPaths().spend, PassJob/PassRecord carry
workspaceId, and the runner is shared app-wide through
WorkspaceServices -> WorkspaceContext.passes. GET
/settings/passes/spend?month=YYYY-MM returns the monthly summary.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@LinuxDevil
LinuxDevil merged commit cb9d8d0 into main Nov 11, 2026
6 checks passed
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.

1 participant