feat(code): import claude code sessions#2873
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
|
| export const recordCliImportInput = z.object({ | ||
| sourceSessionId: z.string(), | ||
| importedSessionId: z.string(), | ||
| repoPath: z.string(), | ||
| taskId: z.string(), | ||
| fingerprint: cliSessionFingerprintSchema, | ||
| }); |
There was a problem hiding this comment.
recordCliImportInput accepts arbitrary strings for sourceSessionId and importedSessionId
Every other endpoint that uses these values as path segments (importCliSessionInput, deleteImportedCliSessionInput, deleteImportRecordInput) enforces z.string().uuid() with the comment "uuid keeps the value safe to use as a path segment." recordCliImportInput does not, even though the importedSessionId is recorded as a DB key and later passed to deleteImportedCliSessionInput / deleteImportRecordInput which do enforce UUID. The inconsistency means a caller that crafts a non-UUID importedSessionId in the record step could produce a row that is un-deletable via the delete endpoints (they'd reject the non-UUID value). In practice both values always come from the import endpoint's output, but adding .uuid() here makes the contract explicit and defends against future callers.
| export const recordCliImportInput = z.object({ | |
| sourceSessionId: z.string(), | |
| importedSessionId: z.string(), | |
| repoPath: z.string(), | |
| taskId: z.string(), | |
| fingerprint: cliSessionFingerprintSchema, | |
| }); | |
| export const recordCliImportInput = z.object({ | |
| /** uuid keeps the value safe to use as a path segment. */ | |
| sourceSessionId: z.string().uuid(), | |
| /** uuid keeps the value safe to use as a path segment. */ | |
| importedSessionId: z.string().uuid(), | |
| repoPath: z.string(), | |
| taskId: z.string(), | |
| fingerprint: cliSessionFingerprintSchema, | |
| }); |
0f599e5 to
2a00a71
Compare
Client side of importing a Claude Code CLI session: the task-creation saga step that snapshots and records the import (with rollback compensation) and links the session's branch, session replay-history loading on connect, and the new-task picker UI for browsing and importing recent CLI sessions for the selected repo. Part 3/3 of splitting #2873 (import Claude Code sessions). Generated-By: PostHog Code Task-Id: 6c93b6e8-27b6-45c8-8135-73a09076ea93
2a00a71 to
1a2fbf6
Compare
Client side of importing a Claude Code CLI session: the task-creation saga step that snapshots and records the import (with rollback compensation) and links the session's branch, session replay-history loading on connect, and the new-task picker UI for browsing and importing recent CLI sessions for the selected repo. Part 3/3 of splitting #2873 (import Claude Code sessions). Generated-By: PostHog Code Task-Id: 6c93b6e8-27b6-45c8-8135-73a09076ea93
8cbec5f to
b944070
Compare
1a2fbf6 to
d8f4c50
Compare
Client side of importing a Claude Code CLI session: the task-creation saga step that snapshots and records the import (with rollback compensation) and links the session's branch, session replay-history loading on connect, and the new-task picker UI for browsing and importing recent CLI sessions for the selected repo. Part 3/3 of splitting #2873 (import Claude Code sessions). Generated-By: PostHog Code Task-Id: 6c93b6e8-27b6-45c8-8135-73a09076ea93
d8f4c50 to
d46b00c
Compare
b944070 to
e9a736c
Compare
Client side of importing a Claude Code CLI session: the task-creation saga step that snapshots and records the import (with rollback compensation) and links the session's branch, session replay-history loading on connect, and the new-task picker UI for browsing and importing recent CLI sessions for the selected repo. Part 3/3 of splitting #2873 (import Claude Code sessions). Generated-By: PostHog Code Task-Id: 6c93b6e8-27b6-45c8-8135-73a09076ea93
e9a736c to
0253564
Compare
d46b00c to
c316286
Compare

🚨 feel free to pull this for testing downstack, but this is not the final UX! PR to be updated soon
Problem
Changes
How did you test this?
Automatic notifications