Skip to content

fix(sessions): keep <workspace_context> directives out of titles and previews#708

Open
bdtsimon wants to merge 1 commit into
outsourc-e:mainfrom
bdtsimon:fix/workspace-context-title-leak
Open

fix(sessions): keep <workspace_context> directives out of titles and previews#708
bdtsimon wants to merge 1 commit into
outsourc-e:mainfrom
bdtsimon:fix/workspace-context-title-leak

Conversation

@bdtsimon

@bdtsimon bdtsimon commented Jul 8, 2026

Copy link
Copy Markdown

Problem

Workspace context directives injected into messages leaked into derived session titles and previews, so Recent Sessions / Sessions Intelligence displayed raw <workspace_context active="true" name="..." path="..."> text. Frontend sidebar cleanup alone wasn't enough because the dashboard reads /api/sessions.

Fix

Sanitize user-visible title/preview candidates on three layers:

  • /api/sessions gateway summary (cleanGatewaySessionSummary) — drops derivedTitle / preview that start with <workspace_context, falling back to a friendly id;
  • normalizeSessions() in the chat utils;
  • the persisted localStorage title store.

Values that start with (or reduce to) a workspace_context directive are dropped; old polluted sessions fall back to a safe Session <id> instead of leaking the directive.

Found and fixed while running a self-hosted deployment.

Reviewed by bdtsimon

…previews

Workspace context directives injected into messages leaked into derived session
titles and previews, so Recent Sessions / Sessions Intelligence displayed raw
"<workspace_context active=... name=... path=...>" text. Sanitize user-visible
title/preview candidates on three layers — the /api/sessions gateway summary,
normalizeSessions() in the chat utils, and the persisted localStorage title
store — dropping values that start with (or reduce to) a workspace_context
directive and falling back to a friendly session id.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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