Skip to content

feat: idle timeout detection before Kernel session expires#155

Draft
fg-nava wants to merge 9 commits intodevelopfrom
feat/session-connection-manager
Draft

feat: idle timeout detection before Kernel session expires#155
fg-nava wants to merge 9 commits intodevelopfrom
feat/session-connection-manager

Conversation

@fg-nava
Copy link
Collaborator

@fg-nava fg-nava commented Feb 20, 2026

No description provided.

@fg-nava fg-nava force-pushed the feat/session-connection-manager branch from cbaa6fd to 9785798 Compare February 20, 2026 16:15
- Add BrowserSession table to persist session mappings across Cloud Run restarts
- Disconnect CDP on component unmount (stops Kernel billing while user is away)
- Reconnect from DB when user returns to chat (reuses same Kernel browser)
- Fall back to DB lookup in getBrowser/getOrCreateBrowser for crash recovery
- Clean up BrowserSession rows on chat deletion
- Increase Kernel timeout from 1h to 24h (browser enters standby at
  zero cost when no CDP/live-view connections are active)
- Update modal copy to explain session preservation behavior
…te modal copy

Browser stop: replace per-session boolean flag with AbortController so
stop signals propagate to queued and in-flight commands immediately,
even when abort fires between tool calls.

Modal: remove "After 1 day, your browser session will be permanently
deleted" line per team discussion.
request.signal propagation is unreliable on Cloud Run with resumable
streams/SSE. Instead of relying on it, the client now sends an explicit
POST to /api/kernel-browser with action: 'stop' which directly aborts
the session's AbortController and severs CDP.
…mselves

The agent was sometimes selecting "applying on behalf of someone else"
because the system prompt said "on behalf of caseworkers". Clarified
that the caseworker is with the participant filling out their own
application, and added explicit rule to always answer "Yes" to
"applying for yourself?" questions.
@fg-nava fg-nava changed the base branch from labs-asp to develop March 2, 2026 19:25
@fg-nava fg-nava marked this pull request as draft March 12, 2026 20:44
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.

1 participant