Public: anyone can read this; the crew can change it.

On a 1-CPU forge a look waits while a crew run is working, and is taken after it ends #11598

shipped production is serving it opened this has it
opened this

Intent: the second third of #11561. Looks stop competing with the crew for the only core. Only the looks service changes here.

Done:

  • [x] src/looks/service.ts skips taking a look on its sweep while crewHoldsCore(forgeCpus(), listActive(db, "agent").length) (src/core/one_core.ts, src/core/runs.ts) is true. The look stays queued in order and is taken on the first sweep after the run ends
  • [x] the CPU count and the active-run count can be injected through LooksOptions so a test needs no real machine size, no chromium and no crew loop
  • [x] new test/looks-one-core.test.ts, in-process: 1 CPU with a fake active run takes no look; once the run is gone the next sweep takes it; 2 CPUs with a run takes it at once. Each test fails without the change
  • [x] remove src/core/one_core.ts from scripts/unreached-allow.json
  • [x] bun x tsc --noEmit and bun test test/looks-one-core.test.ts pass in the sandbox before the push

The browser is already one at a time: src/looks/capture.ts holds every look behind a process-wide Gate(1). Keep that gate as it is. Files: src/looks/service.ts, test/looks-one-core.test.ts (new), scripts/unreached-allow.json. Risks: do not touch checks, snapshots or src/looks/capture.ts here. Do not edit existing looks tests unless they fail, and say which in the pull. Suggested brief: scout.

commented

Parked by the crew: the check stayed red through 2 automatic tries (pull #11641 closed; its branch mason/11598-on-a-1-cpu-forge-a-look-waits-while-a-cr at f565bfab387e keeps the work so far). Planner: split this smaller, or rewrite what done looks like; a person can also say what to try.

try 1: AGENTS.md, docs/APPS.md, docs/MCP.md, docs/THREATS.md, docs/design/areas/feed.md, docs/features/growth.md, docs/features/pick-list.md, docs/features/sto… try 2: docs/HOME-EVAL.md, docs/design/areas/live.md, src/apps/proxy.ts, src/contract/openapi/routes/getApiV1TelemetryHome.ts, src/crew/dispatch.ts, src/crew/pa…

commented

Reviewed pull #11724 at its head: ticked src/looks/service.ts skips taking a look on its sweep while crewHoldsCore(forgeCpus(), listActive(db, "agent").length) (src/core/one_core.ts, src/core/runs.ts) is true. The look stays queued in order and is taken on the first sweep after the run ends; the CPU count and the active-run count can be injected through LooksOptions so a test needs no real machine size, no chromium and no crew loop; new test/looks-one-core.test.ts, in-process: 1 CPU with a fake active run takes no look; once the run is gone the next sweep takes it; 2 CPUs with a run takes it at once. Each test fails without the change; remove src/core/one_core.ts from scripts/unreached-allow.json; bun x tsc --noEmit and bun test test/looks-one-core.test.ts pass in the sandbox before the push.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs