Skip to content

Conversation

@darshkpatel
Copy link
Contributor

@darshkpatel darshkpatel commented Jan 12, 2026

Summary

Fixes #8073

  • Added await to the auth.set() call in the /model dialog to ensure the API key is persisted before instance.dispose() and sync.bootstrap() run

Root Cause

The auth.set() call was not being awaited, causing a race condition where the bootstrap would happen before the auth data was written to disk. This resulted in the API key not being loaded after entry, requiring a restart.

Reproduction of the bug

opencode-apikey-bug.mp4

Bug fix

opencode-apikey-bugfix.mp4

@darshkpatel darshkpatel marked this pull request as draft January 12, 2026 21:39
@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

@darshkpatel darshkpatel marked this pull request as ready for review January 12, 2026 21:42
@darshkpatel darshkpatel marked this pull request as draft January 12, 2026 23:08
When manually entering an API key via /model dialog, the auth.set() call
was not being awaited, causing a race condition where instance.dispose()
and sync.bootstrap() would run before the auth was saved to disk.

This resulted in the API key not being loaded after entry, requiring a
restart to pick up the key.
@darshkpatel darshkpatel marked this pull request as ready for review January 12, 2026 23:18
@rekram1-node rekram1-node merged commit bf37a88 into anomalyco:dev Jan 13, 2026
3 checks passed
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.

API key entered via /model dialog not loaded until restart

2 participants