fix(tui): refresh form blockers on reconnect

This commit is contained in:
Aiden Cline 2026-07-03 13:35:52 -05:00
commit e7ce32c3f5
2 changed files with 14 additions and 1 deletions

View file

@ -863,7 +863,7 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({
directory: defaultLocation().directory,
workspace: defaultLocation().workspaceID,
})
.then((response) => {
.then(async (response) => {
setStore(
"session",
"info",
@ -872,6 +872,18 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({
}),
)
for (const session of response.data) registerSession(session.id)
await Promise.all(
Object.values(store.session.info).flatMap((session) =>
session.parentID ? [] : [result.session.refreshChildren(session.id)],
),
)
await Promise.all([
...Object.keys(store.session.info).flatMap((sessionID) => [
result.session.permission.refresh(sessionID),
result.session.form.refresh(sessionID),
]),
result.session.form.refresh("global"),
])
}),
sdk.api.session
.active()

View file

@ -99,6 +99,7 @@ export function createFetch(override?: FetchHandler, events?: ReturnType<typeof
if (url.pathname === "/api/mcp") return json({ location: { directory, project: { id: "proj_test", directory: worktree } }, data: [] })
if (url.pathname === "/api/session") return json({ data: [], cursor: {} })
if (url.pathname === "/api/session/active") return json({ data: {}, watermarks: {} })
if (/^\/api\/session\/[^/]+\/(permission|form)$/.test(url.pathname)) return json([])
if (
["/api/agent", "/api/model", "/api/provider", "/api/integration", "/api/command", "/api/skill"].includes(
url.pathname,