Stage image attachments for agent sessions - #89
Open
cristicretu wants to merge 2 commits into
Open
cristicretu wants to merge 2 commits into
cristicretu wants to merge 2 commits into
Conversation
cristicretu
force-pushed
the
codex/issue-77-image-attachments
branch
from
August 13, 2026 08:34
f3fb204 to
6359c04
Compare
cristicretu
force-pushed
the
codex/issue-77-image-attachments
branch
from
August 13, 2026 11:42
6359c04 to
5d5dfe5
Compare
cristicretu
force-pushed
the
codex/issue-77-image-attachments
branch
from
August 13, 2026 20:11
5d5dfe5 to
866e7ae
Compare
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.
Summary
session.send_text(submit: true)RPCBehavior and safety
Local originals are copied from one no-follow file descriptor into generated owner-only staging files. The same descriptor supplies metadata, signature validation, and bounded bytes, closing path-swap and symlink races. User filenames never enter the delivery surface, originals are never deleted, and oversized batches are rejected before paths beyond the remaining count are opened. Draft copies are released on remove, clear, or removed-session pruning; acknowledged submissions persist a 24-hour lease so the agent can still open the path if the app exits, with narrowly scoped stale-process cleanup on a later launch.
Image staging is asynchronous and does not auto-send. Generation and target guards prevent a late File Provider/drop completion from attaching to a newly selected draft, while Clear invalidates all pending staging work. Existing-session submission is single-flight: Escape, click-away, editing, removal, and draft switching remain frozen until the RPC settles; a real asynchronous RPC failure leaves the composer, text, and private image leases intact with visible feedback.
Remote acceptance remains authorization-bound
Remote delivery is deliberately fail-closed and is not implemented by this PR. The issue acceptance criterion requiring image upload to remote sessions therefore remains blocked on a separately authorized protocol change. A direct app-owned SSH/SCP implementation was rejected during review because it would introduce unapproved image egress and bypass Diri's remote-helper boundary.
The safe implementation requires a versioned, engine-owned, session-authorized upload RPC plus Remote Helper protocol support: nonce-scoped owner-only destinations, all-or-nothing writes, paths returned only after the whole batch succeeds, rollback, and TTL cleanup. The current UI instead shows
Remote image upload is unavailable in this build; nothing will be sentand preserves the draft. This PR references rather than closes #77 for that reason.Validation
cargo test --workspace(all unit, integration, and doc suites passed;diri-app: 382 passed, 2 ignored)cargo clippy --workspace --all-targets -- -D warningscargo check --workspace --all-targetscargo fmt --all -- --checkgit diff --checkcargo build --workspace --releaseDependency
Stacked on PR #84 (
codex/issue-73-finder-drops) because this deepens its session-rowExternalPathsrouting. Please review/merge #84 first.Refs #77