Repository navigation
chore: Revert "fix(cli): navigate artifact on fork source links" - #795
Conversation
This reverts commit 0c571ca.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (11)
📝 WalkthroughWalkthroughThis PR removes the generic artifact AI chat handoff/navigation module from packages/artifacts (including exports, tests, README docs) and replaces it with a self-contained handoff controller in apps/sqlrooms-cli-ui. It also simplifies createWorksheetAgentTool's mutation-check logic and removes the onSwitchToForkSource prop from ChatMessagesContainer in favor of direct switchSession calls. ChangesArtifact chat handoff and session switching refactor
Worksheet agent tool mutation-check simplification
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant Command
participant commandMiddleware
participant Store
participant onChatFinish
Command->>commandMiddleware: run AI-surface invocation
commandMiddleware->>Store: resolve source artifact id
commandMiddleware->>commandMiddleware: parse artifactTargetChange
commandMiddleware->>Store: record pending handoff
Store->>onChatFinish: chat session finishes
onChatFinish->>Store: verify source/target artifacts and last user message id
onChatFinish->>Store: fork target session, assign target artifact, select session
Possibly related PRs
Suggested reviewers: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6e3ababcbd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| onSwitchToSource={() => { | ||
| if (!sourceSession) return; | ||
| if (onSwitchToForkSource) { | ||
| onSwitchToForkSource(sourceSession, forkOrigin); | ||
| return; | ||
| } | ||
| switchSession(sourceSession.id); | ||
| if (sourceSession) switchSession(sourceSession.id); | ||
| }} |
There was a problem hiding this comment.
Select owning artifact before switching to fork source
When the fork provenance points to a session owned by another artifact, clicking “Forked from …” now calls only ai.switchSession. In the CLI store, artifactAi.syncCurrentArtifactAiSession observes the AI-config change while currentArtifactId is still the target artifact and re-selects that artifact’s latest session, so the source link appears to do nothing instead of navigating back to the source artifact. Select the owning artifact before switching sessions, or restore a host callback for artifact-scoped chats.
Useful? React with 👍 / 👎.
| return { | ||
| success: true, |
There was a problem hiding this comment.
Do not report success without worksheet changes
For create/update intents such as “add a scatter plot”, if the sub-agent answers with text or only runs read-only query tools, this wrapper now unconditionally returns success: true without checking whether any worksheet block was added or mutated. That leaves the parent chat believing the worksheet changed even though no chart/block was created; mutation requests should retry or fail when no worksheet mutation occurred.
Useful? React with 👍 / 👎.
| const targetSessionId = state.ai.forkSessionFromMessage({ | ||
| sourceSessionId: handoff.sourceSessionId, | ||
| sourceMessageId: assistantMessage.message.id, | ||
| sourceMessageIndex: assistantMessage.index, | ||
| name: `Continue: ${targetArtifact.title}`, | ||
| }); |
There was a problem hiding this comment.
Copy chart blocks before same-chart handoff forks
When a worksheet user asks to create a new worksheet with the same/copy chart, this path now forks the chat into the target worksheet without writing any chart blocks to that empty target. The fork only creates chat provenance and session ownership, so these copy-chart handoffs leave the newly selected worksheet blank instead of carrying over the requested chart content.
Useful? React with 👍 / 👎.
Reverts #786
Summary by CodeRabbit
Refactor
Bug Fixes