mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-09-24 16:02:55 +08:00
fix(vscode): backfill agent selections when agentsLoaded arrives after messagesLoaded
This commit is contained in:
@@ -483,6 +483,17 @@ export const SessionProvider: ParentComponent = (props) => {
|
||||
}
|
||||
}),
|
||||
)
|
||||
|
||||
// Rescan already-loaded message history so sessions whose messagesLoaded
|
||||
// arrived before agentsLoaded (and therefore got no agent selection) are
|
||||
// backfilled now that we know the valid agent names.
|
||||
batch(() => {
|
||||
for (const [sid, msgs] of Object.entries(store.messages)) {
|
||||
if (store.agentSelections[sid]) continue
|
||||
const agent = resolveSessionAgent(msgs, names)
|
||||
if (agent) setStore("agentSelections", sid, agent)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
// Request agents in case the initial push was missed.
|
||||
|
||||
Reference in New Issue
Block a user