Repository navigation
fix: resolve default model for sessions created before login - #60
Merged
Merged
Conversation
added 2 commits
July 28, 2026 14:17
When the agent starts without auth.json, sessions are created with empty model. After login, reload_credentials skipped them because self.model.is_empty() returned early. Now reload_all_credentials resolves and applies the default model for empty-model sessions, so the user can prompt immediately after login in the default thread.
huichen
added a commit
that referenced
this pull request
Sep 27, 2026
…0) (#879) #877 (coverage) carried a stale gitlink and reverted the pin #872 had just moved, so `main` pointed at 1ece355 while the skills repo had moved on. Restore the pin to 23925fc (future-skills main), which is the same content #872 shipped. Skills repo commits covered by the range 1ece355..23925fc: - #57 document task write scopes and safe dependency wiring - #59 repair builtin lookup/design helpers, retire unsafe review generator - #58 future-slides defaults to editable decks with native validation - light-weight code-development skill (future-code) - #60 coalesced supervisor delivery for future-loop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
GUI 客户端首次登录后,默认打开的会话对话提示「密钥无效或已过期」。切换到其他会话正常。
根因
时序问题:
reload_agent_credentials()调用reload_credentials()对空 model session 直接 return(跳过刷新)set_model不触发 → 无 API key → 报错修复
reload_all_credentials()中,对 model 为空的 session 不再跳过,而是解析默认模型并调set_model(完整走 API key 解析路径)。写锁内重新检查
model.is_empty()防止 TOCTOU 竞态。改动
agent/src/rpc/mod.rs—reload_all_credentials()方法