Skip to content

feat: server WebSocket layer for per-project context#64

Merged
nonogv merged 1 commit into
mainfrom
feat/server-project-context
Jun 6, 2026
Merged

feat: server WebSocket layer for per-project context#64
nonogv merged 1 commit into
mainfrom
feat/server-project-context

Conversation

@nonogv

@nonogv nonogv commented Jun 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • Implements the full backend stack for per-project context layering: storage (PR1), chat prompt injection (PR2), and server WebSocket handlers (PR3) on a single self-contained branch for review.
  • Storage: project-scoped history, instructions, memories, snapshots; legacy history.json migration; loadPromptContext() helper.
  • Chat: PromptContext interface and buildSystemPrompt context sections appended at the end.
  • Server: historyRef pattern for project switching; new WS messages (project, context, context_saved, project_stale); handlers for get/set/clear_project, get_context, save_instructions, save_memories, refresh_project_memories.

What was NOT touched

  • ui/ — frontend (PR4) is out of scope for this PR.

Tradeoffs

  • This branch includes PR1+PR2 changes inline so it compiles and is reviewable before those PRs merge. It should be rebased after PR1 and PR2 land in main to drop duplicate commits.
  • save_project_snapshot is only called on refresh_project_memories, not on manual save_memories (per contract).

Test plan

  • npm test — 97 tests pass
  • npm run build — TypeScript + extension + UI build succeed
  • Manual: connect UI, verify project + context frames on connect
  • Manual: switch project, confirm history isolation
  • Manual: refresh project memories streams and saves snapshot

Made with Cursor

Wire project switching, context persistence, stale detection, and
memory refresh over WebSocket. Includes storage and chat deps for a
self-contained review branch ahead of PR1/PR2 merge.

Co-authored-by: Cursor <cursoragent@cursor.com>
@nonogv nonogv force-pushed the feat/server-project-context branch from d3f9ce9 to dbd58fa Compare June 6, 2026 17:38
@nonogv nonogv merged commit 44641d7 into main Jun 6, 2026
1 check passed
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