Skip to content

fix: bootstrap runtime catalog and migrate accounts in governance sync#335

Open
08mamba24 wants to merge 4 commits intozts212653:mainfrom
08mamba24:fix/external-project-account-resolution
Open

fix: bootstrap runtime catalog and migrate accounts in governance sync#335
08mamba24 wants to merge 4 commits intozts212653:mainfrom
08mamba24:fix/external-project-account-resolution

Conversation

@08mamba24
Copy link
Copy Markdown
Contributor

Summary

Fixes the issue where @opencode/@dare/@gemini mentions fail in external project threads with error failed to resolve bound account "my-glm".

Root Cause

The new F136 account resolution chain (account-resolver.ts) only reads project-local accounts from cat-catalog.json. External projects after governance sync only have governance files (managed blocks, skills, report) but are missing .cat-cafe/cat-catalog.json and accounts. This causes resolveForClient(projectRoot, ..., "my-glm") to return null for external projects, while it works fine for the Cat Cafe runtime root.

Solution

Extended the governance bootstrap to also bootstrap runtime catalog and migrate legacy provider profiles into target project accounts:

  1. Runtime catalog bootstrap: Creates .cat-cafe/cat-catalog.json in external projects using cat-template.json from Cat Cafe root
  2. Legacy account migration: Executes migrateProviderProfilesToAccounts(targetProject) to migrate legacy profiles from provider-profiles.json into the target project's catalog accounts, and credentials to global credentials store

This ensures external projects have a complete runtime catalog with accounts after governance sync, satisfying the resolver's requirements.

Changes

  • packages/api/src/config/governance/governance-bootstrap.ts: Added bootstrapRuntimeCatalogAndAccounts() method and integrated it into the bootstrap flow
  • packages/api/test/governance/governance-bootstrap.test.js: Added test coverage for legacy profile migration to project catalog accounts

Testing

All governance-related tests pass (22/22):

  • test/governance/governance-bootstrap.test.js
  • test/governance/governance-confirm.test.js
  • test/governance/governance-integration.test.js

Related

Based on diagnosis from @Sonnet and implementation by @codex.
Commit: 7ab7dc0

08mamba24 and others added 3 commits March 30, 2026 21:04
- Add VALID_EFFORT_BY_PROVIDER and DEFAULT_EFFORT_BY_PROVIDER constants
- getCatEffort() now validates effort values against provider specs
- Auto-maps invalid values (e.g., "max" for Codex → "xhigh")
- Added 8 tests covering anthropic, openai, google providers

Fixes bug where cli.effort="max" caused Codex CLI to crash on startup.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@08mamba24 08mamba24 requested a review from zts212653 as a code owner April 1, 2026 05:21
@chatgpt-codex-connector
Copy link
Copy Markdown

To use Codex here, create an environment for this repo.

- Fixed import order in governance-bootstrap.ts
- Fixed function parameter formatting
- Fixed ternary expression formatting
- Added trailing comma in cat-config-loader.ts

Resolves CI Lint failures.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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