Skip to content

Pacing gate: project-config model still held when the other account has not scanned the folder (#566 review) #568

Closed

Description

@scuttletoby

Follow-up from the review of #566 (Fixes #559): #566 (comment)

Problem. When only this call's target lookup scans the project folder, the pacing gate still holds a model that is listed only in that project's provider config. The real refreshWorkspaceSnapshot scans only the requested account (instance). The other account of the same provider has no snapshot for that folder, so the switch check refuses the model there. The result is usage_pacing_hold with "No other account of this provider has room", even though one does. A fresh refresh on one account also drops the other accounts' snapshots for that folder.

The #566 test hides this, because its mock scans every account at once. A mock that scans one account at a time shows it (in OrchestratorMcpService.usageGate.test.ts):

refreshWorkspaceSnapshot: ({ instanceId }) =>
  Ref.updateAndGet(registry, (current) =>
    current.map((provider) =>
      provider.instanceId === instanceId
        ? ((input.scanned ?? input.providers).find((p) => p.instanceId === instanceId) ?? provider)
        : provider,
    ),
  ),

With that mock, the "lookup-scans" case of the project-model switch test fails.

Fix to make.

  1. The switch check scans the folder for each other account it considers, or resolves project models per account the same way the lookup does.
  2. Use the per-account mock above in the tests.
  3. Make the hold message true in this case.
  4. Minor: the project folder is read twice, and if the second read fails the gate falls back to the unmerged list. Read it once.

State question: runs again, stopped half-way, no, empty or unscanned project config.

Activity

  1. added 4 commits that reference this issue on Nov 21, 2026
    905b54c
    3a57b62
    15cda20
    52d3531
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions