Auto-discover Fireworks account slugs and surface wrong-slug errors - #3074
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: Auto-discover Fireworks account slugs and surface wrong-slug errors This is item 1/1 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 95359ba2f8
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| private static func persistAccountSlug(_ accountSlug: String) throws { | ||
| let store = CodexBarConfigStore() | ||
| var config = try store.load() ?? .makeDefault() | ||
| var providerConfig = config.providerConfig(for: UsageProvider.fireworks.instanceID) | ||
| ?? ProviderConfig(id: UsageProvider.fireworks.instanceID) |
There was a problem hiding this comment.
Persist discovered slugs through the live settings owner
When discovery completes while SettingsStore.schedulePersistConfig() still has a debounced write pending—for example immediately after the user enters the API key—this independent read-modify-write starts from the older on-disk configuration. Its save can make the file watcher reload that stale configuration and discard the newly entered key or another concurrent setting; if the pending settings write wins instead, it drops the discovered slug and forces discovery again. Route this mutation through the live SettingsStore/fetch-context update mechanism, with the existing revision guard, rather than writing a separate disk snapshot.
Useful? React with 👍 / 👎.
Summary
Fixes #3068. Fireworks removed the account slug from the console billing URL, so the setup instructions pointed at a dead flow and a wrong slug produced a silent "refresh succeeded" with no data.
GET /v1/accounts(accounts visible to the API key exposeaccounts/<slug>): a sole account is used and persisted automatically; multiple accounts produce an error listing the candidate slugs.firectl whoamiinstead of the removed billing-URL segment.Test plan
make checkclean