Skip to content

Auto-discover Fireworks account slugs and surface wrong-slug errors - #3074

Merged
steipete merged 2 commits into
mainfrom
codex-3068
Aug 19, 2026
Merged

Auto-discover Fireworks account slugs and surface wrong-slug errors#3074
steipete merged 2 commits into
mainfrom
codex-3068

Conversation

@steipete

Copy link
Copy Markdown
Owner

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.

  • Auto-discover the slug via the control-plane GET /v1/accounts (accounts visible to the API key expose accounts/<slug>): a sole account is used and persisted automatically; multiple accounts produce an error listing the candidate slugs.
  • A configured slug that 404s retries discovery instead of failing dead.
  • Empty billing responses for a configured slug now surface an explicit "account not found for this API key" error instead of silently succeeding.
  • Settings guidance and docs point at the account switcher / firectl whoami instead of the removed billing-URL segment.

Test plan

  • 13 focused Fireworks tests: wrong-slug error, single-account discovery, multi-account ambiguity, 404 recovery (all stub-based, no live network)
  • make check clean

@clawsweeper

clawsweeper Bot commented Aug 19, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@clawsweeper

clawsweeper Bot commented Aug 19, 2026

Copy link
Copy Markdown

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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +102 to +106
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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@steipete
steipete merged commit 9654802 into main Aug 19, 2026
9 checks passed
steipete added a commit that referenced this pull request Aug 19, 2026
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.

Fireworks: no longer uses account slugs

1 participant