Repository navigation
feat(sessions): report a re-import's new messages and its refusals - #684
Merged
Merged
Conversation
Base Code now appends only the newer turns when a session is imported again into its branch (base44-dev/apper#35818). The response's `reimported` flag picks the success line: "Added N new messages to <branch>" or "Nothing new to import". 409 `session_changed` and `branch_busy` get plain messages. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
🚀 Package Preview Available!Install this PR's preview build with npm: npm i @base44-preview/cli@0.2.6-pr.684.c1fb02fPrefer not to change any import paths? Install using npm alias so your code still imports npm i "base44@npm:@base44-preview/cli@0.2.6-pr.684.c1fb02f"Or add it to your {
"dependencies": {
"base44": "npm:@base44-preview/cli@0.2.6-pr.684.c1fb02f"
}
}
Preview published to npm registry — try new features instantly! |
netanelgilad
approved these changes
Oct 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Description
Teaches
base44 sessions importabout re-importing a session that already has a live Base Code branch. The server can now answer a repeat import by appending only the newer messages (reimported: true, withturn_countcounting just the new ones), so the CLI reports that outcome distinctly instead of claiming a fresh import, and it translates the two new 409 refusals (session_changed,branch_busy) into plain messages an agent can relay.Related Issue
None
Type of Change
Changes Made
core/session-import/api.ts: addedreimportedto the success schema, defaulted tofalseso servers without re-import support still validate, and exposed it on the camelCase transform.core/session-import/api.ts: mapped 409session_changed(earlier messages no longer match — points at the branch and tells the user to pick "Import into a new branch") and 409branch_busy(the branch is mid-turn) to plain messages, both falling back gracefully whendetails.branch_nameis absent.cli/commands/sessions/import.ts: extracted the success line into anoutcome()helper covering three cases — re-import with new messages ("Added N new messages…"), re-import with nothing new ("Nothing new to import…"), and the existing fresh/continued import wording.tests/cli/sessions_import.spec.ts: added abranch_busycase to the HTTP error-mapping table and a parameterized test for the two re-import success lines (3 new messages and 0).docs/commands.md: documented re-import semantics and the new 409 codes.Testing
npm test)Checklist
docs/(AGENTS.md) if I made architectural changesAdditional Notes
The change is backward compatible in both directions: an older server that omits
reimportedstill parses (the field defaults tofalseand the original wording is used), and unmapped error codes keep falling through to the existing generic handling.docs/commands.mdalso mentions 409wrong_session(a key minted for another session's branch), which has no bespoke message here and relies on the generic error path.🤖 Generated by Claude | 2026-10-29 13:26 UTC | c1fb02f