Repository navigation
feat(studio): L06a PassRunner queue and spend.jsonl spend log - #1070
Merged
Merged
Conversation
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>
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
server/passes/passRunner.ts: in-processPassRunner— FIFO queue, concurrency 2, dedupe bykind: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-onlyspend.jsonlatstudioPaths().spend(Studio-global) +summarizeSpend.PassRecord(now withworkspaceId) and ends onepass.<kind>span on the lazystudio-passesobserve reporter.WorkspaceServices.passRunner→WorkspaceContext.passes(one runner per app, shared by every workspace);createAppgainspassRunner/spendLogoptions;startStudioServerbuilds 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-forgenpx fallow audit— cleanGenerated with Devin