Skip to content

refactor(components): extract session submission boundary - #705

Draft
zxch3n wants to merge 2 commits into
mainfrom
refactor/attachment-submission-boundary
Draft

zxch3n wants to merge 2 commits into
mainfrom
refactor/attachment-submission-boundary

Conversation

@zxch3n

@zxch3n zxch3n commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Related issue

Stack 1/4 for attachment drafts. Base: main. Subsequent layers will own resources, durable submission/delivery, and the complete draft experience.

Problem / pressure

Creation, continuation, dispatch, and guide orchestration currently lives in a React hook. Deferred attachment sending needs to call the same path after the composer unmounts, without introducing another writer or changing upload timing during extraction.

Summary

Extract createSessionSubmission with explicit admission and observation bindings. Keep useSessionActions as the React adapter and preserve existing routing, analytics timing, IDs, and acceptance behavior. Add the bilingual draft spec and owning decision note, including the separate scope for upload-free local references. This layer does not enable draft uploads or durable recovery.

Visual explanation

Existing chat / child / continuation entry points
  → useSessionActions (admission, analytics, atoms)
    → createSessionSubmission (create, append, dispatch, guide)
      → existing WorkspaceWriter + Machine RPC

Before / after

Before After
Submission orchestration is inside a React hook An ordinary Promise service owns it; the hook binds UI observations
Two tests assert writer calls only They verify the readable initial/continuation history and preserved input

Test plan

  • Repository typechecking and lint passed; components: 3,656 tests; shared: 1,194; Electron: 112.
  • The full pnpm check run stopped on one unchanged CLI worktree-GC assertion comparing macOS /var and /private/var aliases; 2,791 other CLI tests passed. Its full 11-test suite passed with TMPDIR=/private/tmp.
  • Remaining i18n, import, platform, public-boundary and docs checks passed separately; pnpm format ran with unrelated changes discarded.
  • No packaged-device draft acceptance: that behavior belongs to later stack layers.

Context handoff

Instructions for reviewing agents

  • Review focus: Compare session-submission.ts with the removed hook bodies, particularly initial metadata, config normalization, and guide promotion.
  • Decisions to challenge: Ensure the extracted observation/admission ports preserve existing timing without claiming durability from writer acceptance.
  • Plausible failures / evidence gaps: Unknown-result reconciliation and independent delivery are explicitly unimplemented here; the CLI path-alias test needs a canonical temp path on macOS.

Authoring context

  • User goal / directives: Implement attachment drafts through a progressively reviewed PR stack.
  • Constraints / non-goals: Keep immediate upload timing and existing local handoff/backfill in this layer; upload-free local references remain separate.
  • Risk-bearing decisions: Keep one history writer and the existing dispatch/guide behavior while extracting ownership boundaries.
  • Destructive or irreversible behavior: No data migration or deletion policy changes.
  • Deliberately not done or tested: Deferred transfer, recovery records and device acceptance belong to later layers.
  • Unknowns / confidence: Behavioral suites pass; the spec remains a draft and is not evidence of the complete feature being implemented.

Keep creation, continuation, dispatch, and guide behavior behind a UI-independent Promise service. Record the staged attachment draft design and validation.

Model: gpt-6
@github-actions

Copy link
Copy Markdown
Contributor

Desktop PR regression failed on commit 834037cb003af1ce9d14408dd3080f765832ede2.

Recordings not attached

  • Run evidence: failure-index.json is missing

The Actions artifact retains the complete trace, screenshots, logs, and runtime evidence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant