Skip to content

Isolate Studio sessions by identity#2887

Draft
yufeng201 wants to merge 2 commits into
mainfrom
codex/studio-session-cache-fixes
Draft

Isolate Studio sessions by identity#2887
yufeng201 wants to merge 2 commits into
mainfrom
codex/studio-session-cache-fixes

Conversation

@yufeng201

Copy link
Copy Markdown
Collaborator

Description

Fix Studio session behavior across identity switches and legacy session scopes. This keeps session lists/messages cached per active identity, preserves readable legacy sessions, and prevents mutating operations from writing back into legacy scope.

Related Issue

N/A

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test update

Changes Made

  • Scope Studio session React Query keys by base URL, role, account, user, and key hash.
  • Merge readable archived messages before live session messages and dedupe by message id.
  • Preserve read-only fallback for legacy viking://session/{id} sessions while forcing writes to canonical user session scope.
  • Generate stable Playground agent session IDs and make title generation language-neutral.
  • Add backend and frontend tests for legacy fallback, session cache keys, archived messages, and Playground session IDs.

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested this on the following platforms:
    • Linux
    • macOS
    • Windows

Checks run:

  • git diff --check
  • uv run pytest tests/service/test_session_service_metrics.py
  • npm run test -- src/lib/sessions/api.test.ts src/lib/sessions/query-keys.test.ts src/routes/playground/-lib/utils.test.ts

Checklist

  • My code follows the project's coding style
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Screenshots (if applicable)

N/A

Additional Notes

Split out from #2882 so reviewers can evaluate session/cache compatibility separately from console metrics/log access and performance chunk splitting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant