Repository navigation
feat(sessions): send the session's artifacts with an import - #686
Merged
Merged
Conversation
An imported session showed the chat but not the deliverable. The import now finds the files the session presented (Claude Code Artifact publishes, Codex app open_in_codex of a file), reads only those paths, and sends them as `artifacts` parts with an `artifact_manifest`, kept under the server's 95 MB request cap. 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.686.434aab7Prefer 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.686.434aab7"Or add it to your {
"dependencies": {
"base44": "npm:@base44-preview/cli@0.2.6-pr.686.434aab7"
}
}
Preview published to npm registry — try new features instantly! |
Raw Windows paths in the fixture's JS string lost their backslashes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
They were dropped from the inlined HTML without a word. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
guyofeck
approved these changes
Nov 1, 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
base44 sessions importnow uploads the artifacts a session produced alongside the conversation, so the imported branch carries the files the session actually presented. A newcore/session-import/artifacts.tsmodule scans the session log for Claude CodeArtifactpublishes and Codexopen_in_codexfile targets, reads only the paths those calls name, and attaches them to the multipart upload with a manifest tying each part back to its tool-use id. The command reports what it sends, why anything was skipped, and the server's saved/not-saved counts.Related Issue
None
Type of Change
Changes Made
core/session-import/artifacts.tswithcollectArtifacts():Artifacttool uses (file_path, noaction/asset/type_url, non-sidechain) and Codexexeccalls thatopen_in_codexatype: "file"target.Writethat no laterEdit/MultiEdittouched; Codex has no fallback.<img src>values that are keys of a publish'sfilesmap asdata:URIs, and reports images that are no longer on disk.core/session-import/api.ts:uploadSession()takesartifacts, appends them as repeatedartifactsparts plus anartifact_manifestJSON (tool_use_id,file_name, in order); neither part is sent when there are none. Response schema gainsimported_artifacts/skipped_artifacts(defaulting to 0 for older servers), transformed toimportedArtifacts/skippedArtifacts.cli/commands/sessions/import.ts: collects artifacts before the upload, logs the list being sent and each skip with its reason, adds anArtifacts: N saved, M not saved.outro line when non-zero, and includessentArtifacts/unsentArtifactsin--jsonoutput.docs/commands.md: new Artifacts bullet documenting discovery, fallbacks, limits, wire format, and output.Testing
npm test)Checklist
docs/(AGENTS.md) if I made architectural changesAdditional Notes
Tests added: an
artifactssuite intests/cli/sessions_import.spec.tscovering a published HTML file with one inlined and one missing image (including the--jsonshape), the last-clean-Writefallback versus a file edited afterwards, and Codexopen_in_codexdedup keeping the last call's id while ignoring abrowsertarget; plustests/core/session-import-artifacts.spec.tsfor budget-driven dropping of the oldest artifacts. The existing happy-path test now asserts noartifact_manifestpart when there are no artifacts. The test suite was not executed in this environment, so the pass boxes are left unchecked.🤖 Generated by Claude | 2026-11-01 07:22 UTC | 434aab7