Skip to content

import agents from zip files - #83

Merged
cynfria merged 9 commits into
mainfrom
agents-import-zip
Aug 18, 2026
Merged

import agents from zip files#83
cynfria merged 9 commits into
mainfrom
agents-import-zip

Conversation

@cynfria

@cynfria cynfria commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Category: new-feature
User Impact: Users can now import an agent directly from a ZIP file created by Berd’s agent export flow.

Problem: Exported agent ZIPs could be shared conveniently, but importing them required manually extracting the archive first. Solution: Accept ZIPs in the existing reviewed import flow, safely locate one supported agent payload, enforce archive and payload limits, and present localized validation errors.

File changes

src/features/agents/lib/agentZipImport.ts
Adds bounded ZIP extraction for one supported PNG, Markdown, or JSON agent payload, with typed validation failures for the UI.

src/features/agents/lib/agentZipImport.test.ts
Covers supported payloads, macOS metadata, malformed and ambiguous archives, filename handling, and nested size limits.

src/features/agents/ui/AgentImportDialog.tsx
Allows ZIP files through the existing file picker and drag-and-drop import surface.

src/features/agents/ui/AgentsView.tsx
Routes ZIP payloads through the same preview and confirmation flows as direct agent files and localizes ZIP-specific errors.

src/features/agents/ui/tests/AgentsView.entry.test.tsx
Verifies portable agent image ZIPs preview and continue into configuration, and ambiguous archives fail visibly.

src/shared/i18n/locales/en/agents.json
Updates supported-format guidance and adds English ZIP validation messages.

src/shared/i18n/locales/es/agents.json
Updates supported-format guidance and adds Spanish ZIP validation messages.

@cynfria
cynfria requested a review from a team August 18, 2026 17:54

@morgmart morgmart left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Automated code review

Fresh static review completed for the exact three-dot comparison f31e8e0...04a2e0b using both the project code-review and wes-review lenses. Final self-check covered the ZIP picker/drop, preview, confirmation, PNG/persona import, malformed/ambiguous/oversized archive flows; accessibility; English and Spanish localization; navigation and consent guards; async reads, errors, never-completes, lifecycle, and races; test honesty; project/design-system rules; duplicate overlap; and blocking evidence plus user effect. Two findings remain: one blocking consent/state-consistency defect and one non-blocking archive-boundary defect. Recommend REQUEST_CHANGES. Supplied GitHub evidence was inspected: checks were structurally available for the exact head; Frontend checks and unit tests were still in progress while the reported Rust, frozen-install, close, and DCO checks had succeeded. Required checks independently govern merge readiness.

Deterministic publication result: 1 blocking and 1 non-blocking finding(s) publishable; 0 duplicate(s) suppressed.

Comment thread src/features/agents/ui/AgentsView.tsx Outdated
Comment thread src/features/agents/lib/agentZipImport.ts

@morgmart morgmart left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Automated code review

Fresh static review completed for the full exact three-dot comparison f31e8e0...b7d4c27 using the project code-review and user wes-review lenses. The two previously reported issues were rechecked and are fixed: replacement selection now clears stale prepared state, and supported entries are counted before duplicate paths collapse. Final self-check covered file-picker and drag/drop entry, ZIP/PNG/Markdown/JSON validation, preview and confirmation, malformed/missing/ambiguous/oversized archives, accessibility, English and Spanish localization, navigation and consent guards, async reads, errors, never-completes, lifecycle and races, test honesty, design-system/project rules, duplicate overlap, and concrete blocking evidence plus user effect. Two new publishable findings remain, including a blocking availability issue from synchronous untrusted archive processing. Recommend REQUEST_CHANGES. Supplied GitHub evidence was inspected and was structurally valid for the exact head: Frontend checks and unit tests and Linux Rust checks were in progress; Windows/macOS Rust, clean-room frozen install, and DCO had succeeded. Required checks independently govern merge readiness.

Deterministic publication result: 1 blocking and 1 non-blocking finding(s) publishable; 0 duplicate(s) suppressed.

Comment thread src/features/agents/lib/agentZipImport.ts
Comment thread src/features/agents/ui/AgentsView.tsx Outdated

@morgmart morgmart left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Automated code review

Fresh static review completed for the full exact three-dot comparison f31e8e0...59420e5 using the project code-review and user wes-review lenses. The resolved stale-preparation, duplicate-entry, and ZIP MIME issues are fixed. The resolved renderer-blocking issue remains present through a different current changed-line entry path and is therefore reopenable under the supplied duplicate policy: gallery drag-and-drop accepts ZIPs but bypasses the new worker-backed preview coordinator. Final self-check covered dialog picker and gallery drop entry, ZIP/PNG/Markdown/JSON validation, worker success/error/timeout/abort behavior, preview and confirmation, malformed/missing/ambiguous/oversized archives, accessibility, English and Spanish localization, navigation and consent guards, async errors and never-completes behavior, lifecycle and races, test honesty, design-system/project rules, duplicate overlap, and blocking evidence plus user effect. Two publishable findings remain. Recommend REQUEST_CHANGES. Supplied GitHub evidence was inspected and structurally valid for the exact head: Frontend checks and unit tests and Linux Rust checks were in progress; Windows/macOS Rust, clean-room frozen install, and DCO had succeeded. Required checks independently govern merge readiness.

Deterministic publication result: 1 blocking and 1 non-blocking finding(s) publishable; 0 duplicate(s) suppressed.

Comment thread src/features/agents/ui/AgentsView.tsx Outdated
Comment thread src/features/agents/ui/AgentImportDialog.tsx Outdated

@morgmart morgmart left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Automated code review

Fresh static review completed for the full exact three-dot comparison f31e8e0...e412b74 using the project code-review and user wes-review lenses. The stale dialog preparation, duplicate ZIP entry, MIME rejection, renderer-thread dialog extraction, and absence of a visible pending state are substantially fixed. The resolved gallery safe-preparation thread had no substantive human reply and its underlying ownership issue still exists: gallery ZIP extraction now uses a worker, but remains outside the dialog's replacement, cancellation, preview, and consent coordinator, so it is reopenable rather than suppressed. Final self-check covered dialog picker and gallery drop flows; ZIP/PNG/Markdown/JSON validation; worker success, error, timeout, abort, replacement, unmount, and race behavior; preview and confirmation; accessibility; English and Spanish localization; navigation and consent guards; test honesty; design-system/project rules; duplicate overlap; and concrete blocking evidence plus user effect. Two publishable findings remain. Recommend REQUEST_CHANGES. Supplied GitHub evidence was inspected and structurally valid for the exact head: Frontend checks and unit tests were in progress; Windows, macOS, and Linux Rust checks, clean-room frozen install, and DCO had succeeded. Required checks independently govern merge readiness.

Deterministic publication result: 1 blocking and 1 non-blocking finding(s) publishable; 0 duplicate(s) suppressed.

Comment thread src/features/agents/ui/AgentsView.tsx Outdated
Comment thread src/features/agents/ui/AgentImportDialog.tsx

@morgmart morgmart left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Automated code review

Fresh static review completed for the full exact three-dot comparison f31e8e0...671149a using the project code-review and user wes-review lenses. All prior automated issues were rechecked and are fixed: rejected replacements clear stale state; duplicate supported ZIP entries are counted before path collapse; platform MIME does not wrongly reject ZIPs; extraction runs in a bounded, cancellable worker; gallery imports route into the same preview-and-confirm coordinator; latest selection wins and close/unmount aborts pending work; pending status is visible, accessible, and localized. Final self-check covered picker selection and gallery drag/drop for ZIP, PNG, Markdown, and JSON; malformed, missing, ambiguous, oversized, and never-completing archives; preview-to-commit source-of-truth consistency; navigation and consent guards; async success, error, timeout, replacement, close, unmount, and race behavior; accessibility; English and Spanish localization; test honesty and discriminating coverage; design-system and project rules; duplicate/overlapping findings; and blocking evidence plus user effect. One new non-blocking resource-lifecycle finding remains. Recommend COMMENT. Supplied GitHub evidence was inspected and structurally valid for the exact head: DCO had succeeded and the combined status was pending; required checks independently govern merge readiness.

Deterministic publication result: 0 blocking and 1 non-blocking finding(s) publishable; 0 duplicate(s) suppressed.

Comment thread src/features/agents/ui/AgentImportDialog.tsx Outdated
All import entry points now share the dialog's preparation flow: worker
extraction, replacement/close cancellation, stale-result suppression, and
preview confirmation. Gallery drops no longer import text agents without
review, and concurrent drops can no longer race. The pending button label
is localized.
@cynfria
cynfria force-pushed the agents-import-zip branch from 9123009 to bc693a2 Compare August 18, 2026 21:08

@morgmart morgmart left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Automated code review

Fresh static review completed for the full exact three-dot comparison 8c06ce5...bc693a2 using the project code-review and user wes-review lenses. All prior automated issues were rechecked and are fixed, including stale preparation state, duplicate ZIP entries, MIME handling, renderer blocking, gallery consent and race ownership, pending localization, and disposal of late aborted preview URLs. Final self-check covered picker and gallery selection/drop for ZIP, PNG, Markdown, and JSON; accessibility; English and Spanish localization; navigation and consent guards; async success, error, timeout, never-completes, replacement, close, unmount, StrictMode lifecycle, and races; archive boundaries; preview URL ownership; test honesty; design-system/project rules; duplicate overlap; and concrete blocking evidence plus user effect. One new blocking lifecycle finding remains. Recommend REQUEST_CHANGES. Supplied GitHub evidence was inspected and structurally valid for the exact head: Frontend checks and unit tests were in progress; clean-room frozen install, Windows/macOS/Linux Rust checks, and DCO had succeeded. Required checks independently govern merge readiness.

Deterministic publication result: 1 blocking and 0 non-blocking finding(s) publishable; 0 duplicate(s) suppressed.

Comment thread src/features/agents/ui/AgentImportDialog.tsx
The initial-file effect now owns its preparation attempt: lifecycle
cleanup aborts the attempt and un-consumes the file so a replayed
effect restarts it, while picker replacements keep ownership. The
prepareImport callback is memoized so effect identity is stable.

@morgmart morgmart left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Automated code review

Fresh static review completed for the full exact three-dot comparison 8c06ce5...912c3b1 using the project code-review and user wes-review lenses. All prior automated issues were rechecked and are fixed, including stale replacement state, duplicate ZIP entries, platform MIME handling, renderer-thread extraction, gallery preview/consent ownership and races, pending feedback and localization, late blob URL disposal, and StrictMode replay. Final self-check covered picker and gallery selection/drop for ZIP, PNG, Markdown, and JSON; accessibility; English and Spanish localization; navigation and consent guards; async success, errors, timeout, never-completes, replacement, close, unmount, StrictMode, and races; archive boundaries; preview-to-commit consistency and resource ownership; test honesty and discriminating coverage; design-system/project rules; duplicate overlap; and concrete evidence plus user effect for blocking severity. Potential concerns that were already present in the exact base rather than caused by this comparison were excluded. No publishable findings or unresolved suppressions remain. Recommend APPROVE. Supplied GitHub evidence was inspected and structurally valid for the exact head: all reported check runs had completed successfully; the combined status remained pending. Required checks independently govern merge readiness, and the publisher refreshes checks before approval.

Deterministic publication result: 0 blocking and 0 non-blocking finding(s) publishable; 0 duplicate(s) suppressed.

Pending checks: 1 check(s) are not complete.

This approval reflects the completed code review only; merge readiness remains governed by the repository's required checks.

@cynfria
cynfria merged commit e579192 into main Aug 18, 2026
8 checks passed
@cynfria
cynfria deleted the agents-import-zip branch August 18, 2026 21:58
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.

2 participants