Skip to content

fix(pstack): respect provider cooldowns and pool availability - #20

Open
ScriptedAlchemy wants to merge 1 commit into
mainfrom
codex/pstack-provider-availability
Open

ScriptedAlchemy wants to merge 1 commit into
mainfrom
codex/pstack-provider-availability

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Problem

pstack resolved exact delegation targets using installation and authentication checks, but did not apply delegation's cooldown and project-aware pool checks. An agent could receive a cooling account or an exhausted pool as its exact target and then have delegate_task reject it.

Changes

  • Use the existing delegationProviderConstraints predicate for both default role selection and explicit targets.
  • Supply the current settings, project ID, provider snapshots, and one Effect clock timestamp from PstackPack.expandComposer.
  • Default roles skip unavailable instances and choose an eligible alternative. Explicit unavailable targets retain the existing parent-model fallback and include the reason.
  • Keep a pool usable when at least one member is healthy and enabled for the project.

This is the remaining pstack availability follow-up to the integration audit. It targets main independently of #19.

Validation

  • Added service regressions for default selection skipping a cooling instance, explicit cooling targets, exhausted pools, a pool whose only healthy member is disabled for the project, and a pool with a healthy eligible member.
  • Before the fix: four regressions failed and the healthy-pool control passed.
  • After the fix: vp run check:changed --serial passed the native project-memory build, formatting, lint, both knip passes, GraphQL generation check, typechecks for three affected packages, and 95 tests across three files.
  • The existing MCP regression still dispatches pstack Opus and Astra targets identically under Claude and Codex parents.
  • Independent source review and git diff --check passed.

Runtime check through PstackPack.expandComposer with fixture providers:

Default with cooling and ready instances:
- architect runners: [1] {"providerInstanceId":"claudeAgent_ready","model":"claude-opus-5-5","options":[{"id":"effort","value":"xhigh"},{"id":"fastMode","value":false}]} [2] inherit
Explicit cooling target:
- architect runners: [1] inherit
- Fallback: architect runners seat 1 claudeAgent/claude-opus-5-5 unavailable (Provider is rate limited. Retry after its cooldown expires.); runs on the parent model.

Delegation continues to recheck availability at dispatch, since quota can change after prompt expansion. Full-suite and build validation remain with CI.

Implemented and verified with GPT-6 Astra Pro in the Codex harness.

Use delegation's project-aware provider constraints when resolving both default and explicit pstack roles. Skip cooling defaults and preserve the visible parent fallback for unavailable targets.

Add service regressions for cooling accounts and exhausted or project-restricted pools.
@changeset-bot

changeset-bot Bot commented Oct 28, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 6cc58f2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

This branch has not been deployed

No deployments
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