Skip to content

Add conversation message branching - #306

Closed
JeffreyDeng-spec wants to merge 2 commits into
mainfrom
tony/release-branch-feature-rebase
Closed

Add conversation message branching#306
JeffreyDeng-spec wants to merge 2 commits into
mainfrom
tony/release-branch-feature-rebase

Conversation

@JeffreyDeng-spec

Copy link
Copy Markdown
Contributor

Summary

  • Add persisted conversation branch metadata for message branches, including fork source task/session/provider and branch lookup helpers.
  • Add branch creation/origin APIs and first-branch-message runtime context so historical message branches fork from the latest completed parent runtime session while preserving the selected root message.
  • Update web chat branching UI, branch quote/default context, and branch sheet return state; update CLI Claude/Codex session fork handling.

Tests run

  • git diff --cached --check
  • pnpm --filter @alook/shared test -- test/queries/conversation-branch.test.ts test/queries/conversation.test.ts test/queries/message.test.ts test/queries/task.test.ts
  • pnpm --filter @alook/web test -- 'src/app/api/conversations/[id]/branches/route.test.ts' 'src/app/api/conversations/[id]/branch-origin/route.test.ts' 'src/app/api/conversations/[id]/messages/route.test.ts' src/components/agent-chat/agent-chat-view.test.ts src/components/agent-chat/message-list.test.ts src/contexts/agent-chat-sheet-state.test.ts
  • pnpm --filter @alook/cli test -- src/daemon/agent/__tests__/claude.test.ts src/daemon/agent/__tests__/codex.test.ts src/daemon/session-runner.test.ts
  • pnpm typecheck
  • pnpm lint
  • CI=1 pnpm test
  • Pre-commit hook reran pnpm typecheck && pnpm lint && pnpm test successfully.

Known residual risk

  • No known blockers. Residual risk is limited to no live production/staging browser smoke in this handoff; branch behavior is covered by targeted and broad automated tests.

Main branch note

  • No GitHub main content was directly changed. This work is isolated to tony/release-branch-feature-rebase and this PR.

@JeffreyDeng-spec
JeffreyDeng-spec requested a review from a team as a code owner June 7, 2026 10:25
@JeffreyDeng-spec
JeffreyDeng-spec deleted the tony/release-branch-feature-rebase branch June 8, 2026 11:25
@JeffreyDeng-spec

Copy link
Copy Markdown
Contributor Author

Superseded by #310 because the original head branch used the wrong tony/ prefix. The branch has been renamed to feat/release-branch-feature-rebase; #310 points to the same accepted head commit cfd7ff11a2e79e3b608c66f1970ae3a71fca91e1.

gusye1234 added a commit that referenced this pull request Aug 4, 2026
…oundation)

Per-user private message bookmark ("mark"), the schema foundation for the
Marked inbox tab (Gus /Gus/uiux #306). Table is keyed by the marking user
(unlike channel-shared community_pin) and visible only to them.

  community_message_mark {id, userId, channelId, messageId, createdAt}
  + UNIQUE(userId, messageId)  -- toggle idempotency; backs the single-row
                                  isMessageMarked read for the menu Mark/Unmark state
  + INDEX(userId, createdAt)   -- Marked-list read, newest-first
  all three FKs ON DELETE CASCADE.

No denormalized seq (the marked-list read joins community_message.seq, like the
pins route). No INDEX(userId, channelId) — that + the per-channel markedIds read
are phase-2 (the inline glyph, cut from phase-1 per Gus #992).

Contract frozen by Cecilia #1004. Routes + query module (Melisa) and the Marked
tab (Shelly) build on this. plans/mark-message.md.
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