Skip to content

V10.5 Task B.1: Frontend — Attach Token for reconnection #915

Description

@up-guillaume

Problem

When mobile user switches apps and returns, WebSocket reconnects but loses execution context.

Solution

Store attach token in localStorage to rejoin ongoing execution:

// When execution starts
const attachToken = uuid();
localStorage.setItem(`chat_${agentId}_${sessionId}`, attachToken);

// On reconnect
const existingToken = localStorage.getItem(`chat_${agentId}_${sessionId}`);
if (existingToken) {
  ws.send(JSON.stringify({ type: 'attach', token: existingToken }));
}

Acceptance Criteria

  • Token stored when execution starts
  • Token used on reconnect
  • Token cleaned up when execution ends

Related

  • Plan: PLAN_V10_5.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions