Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/parity/drawer.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/parity/server.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Status values: `todo`, `partial: <what is missing>`, `done`, `n/a: <reason and w
| `OpenCodeClient+Requests.swift` | `live/LiveRequests.kt` | done | Audited r3: 60 s location-boot timeout on both parallel reads (permissions error wins), root-lineage walk, permission/form reply bodies and `"global"` `location[directory]` from `PromptContext.formLocationDirectory`, cancel `message` query Synced to iOS p229 (8705cdb4): form reply/dismissal settle through `GET /api/session/{id}/form/{formID}` when a send may have landed or got 409 (`FormSettlement`); settled ones throw `requestSettled`. Ported ahead of the next sync (417e5b4c): an attention read asks up to `CONCURRENT_ATTENTION_DIRECTORIES` (4) directories at once and fails if any does. |
| `OpenCodeClient+Sessions.swift` | `live/LiveSessions.kt` | done | Audited r3: `/wait` long poll loop (25 s, `.once`, < 20 s = fast pass, 12 fast passes, `.once` active probe, caller-owned retries throw after the probe, `.sessionWait` jitter on the `Clock` dependency); every route's query, timeout (rename 60/10 s, export 60 s) and idempotency match; metadata PATCH merges JSON Synced to f657969b: `requestRootSessions` (archived=false, archived filtered), `requestMoveSession` (`.unsafe`, 15 s), `requestArchiveSession` (`.idempotent`, 10 s; Android only: it reads the session back and fails when it's still unarchived, as servers before 2.1.0 answer 204 and ignore `archived`), Android only (the drawer's Archived page, as desktop): `requestArchivedSessions` (`archived=true`, `parentID=null`, `desc`, `search` when typed) and `requestUnarchiveSession` (same PATCH with `archived:false`), view receipts registered with `SelfViewReceipts` (answered when cancelled, as iOS `Task.isCancelled`). Sync p244 (iOS e8e7cc13..da365285): `requestSessionPage`: `GET /api/session?search=` or `?cursor=` with `limit`, drops archived and child sessions, an empty page ends the list. |
| `OpenCodeClient+SharedEvents.swift` | `live/SharedEvents.kt` | done | `SharedEventStreams`/`SharedReads` ported; gated by `MultipleWindows.isSupported` (default false = iPhone behaviour) R3 audit: per-server channel, late joiner `.connected`, shared end error, last-leaver cancel, 150 ms join window and keys checked; no divergence. 390f157d: buffers `EventBatcher.BUFFER_CAPACITY`. |
| `OpenCodeClient+Shells.swift` | `live/LiveRequests.kt` | done | Audited r3: `location[directory]` on every route, output `cursor`/`limit` with 20 s timeout, running-only list, DELETE stop |
| `OpenCodeClient+Shells.swift` | `live/LiveRequests.kt` | done | Audited r3: `location[directory]` on every route, output `cursor`/`limit` with 20 s timeout, running-only list, DELETE stop Android ahead of iOS (desktop port): `runningJobs` (`GET /api/experimental/job?sessionID&descendants=true&status=running`) and `cancelJob` (`POST …/cancel`, idempotent) beside the shell routes; `experimental.job.updated` decodes to `OpenCodeServerEvent.JobUpdated` (`OpenCodeJob` in `model/Models.kt`). |
| `OpenCodeClient+Transcript.swift` | `live/LiveTranscript.kt` | partial: Markdown is parsed in the row, not at decode | Same item IDs, bounding (20 000 chars / 100 items), tool images (16 / 20 MB / 32 MB, `data:<mime>;base64` header; f657969b: placeholder text parts become unavailable images, `media:` file URIs reference images), user images through `FilePayload.attachedImages`, context usage (8-message window), synthetic notices, reply span, run-error text (r3: provider JSON split now drops empty pieces like Swift's `split`). **Not equivalent:** `assistantMarkdown` and compaction summaries carry trimmed Markdown text (the Markdown model lives in `:feature:transcript`). iOS parses `[OpenCodeMarkdownBlock]` once at decode, off the main thread, and every consumer reads those blocks. Android parses in composition (`rememberMarkdownBlocks` → `MarkdownStreamStore`, cached per part ID + text, LRU of 16 parts), so history rows parse on the main thread on first display, and a row disposed after 16 other parts were shown parses again. Closing it needs a transcript-side block cache filled off-main when a window is decoded. `VoiceHandoff.parse` is mirrored as internal `isVoiceDelegation` (validity check only). `LabMarks` n/a Sync 03adf07a (c8b93a9d, ed9d54e1, 6a9a30c7): `ParsedMessageCache` (256 messages keyed by message ID + payload hash, drops the least recently read half when full, never keeps rows with inline image bytes or pasted files over 64 KB) reuses parsed rows of unchanged messages in `requestMessage` and `decodeTranscriptPage`; history pages are 80 messages (`HISTORY_PAGE_LIMIT`) with a 20 s timeout and `history_page_request/response/bytes/decode_start/decode_end` marks through `LabMarks`. Hash-backed tool videos keep their content index and are separate from tool images. Tool output and metadata bounds go through `OpenCodeToolBounds` (72a78460). |
| `OpenCodeClient+Transport.swift` | `live/LiveTransport.kt` | done | `perform`/`request`/`decoded` with the same copy, `Accept`/`Content-Type`, correlation headers (`X-OpenCode-Op/Req/Attempt`, uppercase UUIDs), per-request idle timeout (connect/read/write; default 10 s), redirect control, `ServerContact` wakes, connection-probe DNS evidence, same `AppLog.network` notice lines (r3: transport failures log `URLError <code> (<exception>)` like iOS's domain/code). `LabNetworkMetricsRecorder`/`DiagnosticsRecorder`/`NetworkObservation` n/a: Diagnostics subsystem (lab metrics) not ported here Synced to f657969b: a tagged `LocationNotFoundError` 404 becomes "The folder is gone"; `applyCapabilities` merges `X-OpenCode-Capabilities: experimental-media-uri` into every `perform`, the event stream, uploads and server-read image fetches (iOS `NetworkObservation` + `perform`). The media fetch (`MediaReferenceClient.liveFetch`) lives here as `live/MediaReferenceFetch.kt` so `:feature:media` reuses the retry/auth/correlation helpers. Sync 3cea48b2 (9c94975e, bf0dbcb7, 5d8b2f8c, 477a3ca5): requests route per attempt (probes don't), forget an address on a transport failure and note answers and timeouts (two timeouts after an answer reset the pools); idempotent, non-probe, non-long-poll GETs run under `untilLinkChanges` and end as `Interrupted` (retried) when the route or pools change. Sync 03adf07a (a099f459, 6a9a30c7): each request takes `sentAt` from `Clock`; `NotSent` forgets the address, other transport failures call `requestFailed(server, url, sentAt)`; answers call `noteAnswer(persistenceID)` (a connection probe passes null), which starts the failure count again. |
| `OpenCodeClientError.swift` | `OpenCodeClientError.kt` | done | `data class … : Exception`; `retryAfter` parses seconds or HTTP dates; `logSummary` Retry-After rounds half-even to one fraction digit like Foundation (r3), and groups thousands (`1,234.5`) as the POSIX number style does (r3 second audit) Synced to f657969b: `FOLDER_GONE_MESSAGE`, `isLocationMissing`, `isLocationMissing(status, body)`. p229: `requestSettled`. |
Expand Down
2 changes: 1 addition & 1 deletion docs/parity/session.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Status values: `todo`, `partial: <what is missing>`, `done`, `n/a: <reason and w
| `OpenCode/Session/AgentActivity/ShellGlyph.swift` | 250 | `ShellOutputMeter.kt`, `ShellGlyph.kt`, `SessionFeatureActivity.kt` | done | Probe cursor uses Int.MAX_VALUE (client takes Int). Sync 3f473f75 (f261300b): no probe while the server isn't answering (`shellGlyphProbe`); each probe sends once (`RetryPolicy.once`). Sync 01eef583 (0f24fbf3): the frame interval moves to `AmbientRate`; n/a (Compose's frame clock drives the glyph).QA AB-01: holds Reduce Motion's still `>` prompt while TalkBack touch exploration is enabled (`rememberTouchExplorationEnabled()`). |
| `OpenCode/Session/AgentActivity/ShellPromptGlyph.swift` | 318 | `agentactivity/ShellPromptGlyph.kt` | done | |
| `OpenCode/Session/BackgroundWorkMotion.swift` | 388 | `BackgroundWorkMotion.kt` | done | Tunables kept as shipped constants. Sync 01eef583 (0f24fbf3): tunables dropped: the morph on `panelOpen`, close on `panelClose` with the throw's speed, resize on `layout`, the return spring on `Motion.release` (Reduce Motion aware), the upward drag through `MotionRubberBand` (slope 0.35). |
| `OpenCode/Session/BackgroundWorkPanel.swift` | 946 | `BackgroundWorkPanel.kt` | done | Liquid Glass → one M3 surface morphing capsule↔panel; drag-to-close via nestedScroll. DEBUG `GlassMorphTrace` and the stage log (`-lab-glass-trace`/`-lab-count-trace`) n/a (lab tooling). As iOS's anchor preference goes with its place, `backgroundActivityAnchor` (a position-aware node) clears the anchor when the pill row's place leaves, and the capsule is a button only while `capsuleShown` (iOS draws `capsuleButton` only then): a faded or gone capsule takes no touch. Android divergence: rows ripple inside the 8 dp inset (iOS lifts a soft highlight there). Sync timeline-motion (iOS 812b9ab5..1793b4bd): a vertical drag on the capsule scrolls the transcript (`passesDragsToTranscript`). Sync e5c22780: `showsCallTranscript` and the latest call transcript are gone. Sync 01eef583 (0f24fbf3): the capsule shows on `microIn` and hides on `microOut`, glyphs on `MotionTransition.swap`, counts on `Motion.reduced`, the panel's height on `layout`, the scrim on `Motion.dim`.QA W-03: rows are `Role.Button` (iOS `Button`, :895); once the panel lands open (`settled`, iOS `.isModal`, :583) TalkBack's focus moves to its first section header through `:core`'s `accessibilityFocusRequest`, and back onto the capsule when it has folded into it (iOS's modal ends on the capsule button, :498). |
| `OpenCode/Session/BackgroundWorkPanel.swift` | 946 | `BackgroundWorkPanel.kt` | done | Liquid Glass → one M3 surface morphing capsule↔panel; drag-to-close via nestedScroll. DEBUG `GlassMorphTrace` and the stage log (`-lab-glass-trace`/`-lab-count-trace`) n/a (lab tooling). As iOS's anchor preference goes with its place, `backgroundActivityAnchor` (a position-aware node) clears the anchor when the pill row's place leaves, and the capsule is a button only while `capsuleShown` (iOS draws `capsuleButton` only then): a faded or gone capsule takes no touch. Android divergence: rows ripple inside the 8 dp inset (iOS lifts a soft highlight there). Sync timeline-motion (iOS 812b9ab5..1793b4bd): a vertical drag on the capsule scrolls the transcript (`passesDragsToTranscript`). Sync e5c22780: `showsCallTranscript` and the latest call transcript are gone. Sync 01eef583 (0f24fbf3): the capsule shows on `microIn` and hides on `microOut`, glyphs on `MotionTransition.swap`, counts on `Motion.reduced`, the panel's height on `layout`, the scrim on `Motion.dim`.QA W-03: rows are `Role.Button` (iOS `Button`, :895); once the panel lands open (`settled`, iOS `.isModal`, :583) TalkBack's focus moves to its first section header through `:core`'s `accessibilityFocusRequest`, and back onto the capsule when it has folded into it (iOS's modal ends on the capsule button, :498). Android ahead of iOS (desktop port, anomalyco/opencode#64790): background jobs (`SessionFeatureJobs.kt`). The session's own running `codemode` jobs show as "N scripts" (rows: the script's first line or its job ID, elapsed, Stop cancels the job), and a subagent stays listed while a running job is owned in its subtree (Stop interrupts it and cancels its tree's jobs). Image and video jobs only keep their subagent listed. Order is desktop's: subagents · scripts · shells. Jobs are listed on open, switch, resume, a move to the background and family rereads (Home sends one on every new stream, so a missed settle goes), then kept by `experimental.job.updated`; no polling. Sync iOS #355 (dec2b938, e1518739, 4fcdc9cb, f9beb70c): with only scripts running the capsule shows the plain busy orb (`AgentActivitySource.Running`), as the desktop's chip does, and each script row keeps `</>`; a script's first line truncates at its end (shells keep middle truncation); a job is kept when its owner or the session that started it is in the tree; switch snapshots keep their tree's jobs (`SwitchSnapshot.applying`) and restore them; a family pick clears pending Stops. |
| `OpenCode/Session/ComposerCallControls.swift` | 101 | `ComposerCallControls.kt` | done | `ComposerCallPress` (tap window 0.35 s, Stop hold 1 s, `isTap` in uptime ms), `ComposerCallButton`, `ComposerStopButton` (moved here from `ComposerViews.kt`). One `pointerInput` loop times each press from touch-down (movement never resets it): a release within the window on the button is a tap; Stop held 1 s (when `holdStartsCall`) calls `onHold` with `Haptic.threshold`; a release in between, after the hold, or off the button does nothing. Accessibility activation always taps. Ripple via a `MutableInteractionSource` instead of SwiftUI's pressed style. Sync dccec82e (da11bb99, dccec82e): new. |
| `OpenCode/Session/ComposerViews.swift` | 927 | `ComposerViews.kt` | done | `ComposerLayout(progress:)` interpolates the input's x, width, the lines' height and y and the row's height with the keyboard morph's `layoutProgress` (720f330e, c511ca54, 8d73ba25, e8168e5f); the fold top is the controls' top once open. `ComposerAccessoryRow` and the `rowReveal*` tunables removed (f0670c5d; composer's `ComposerKeyboardReveal`). UndimmedWhilePressed / ComposerPasteDestination / tuning presets n/a. Sync to f657969b: 89231d5f removed dead helpers (nothing on Android); 300220d1 keeps the flag-off row main's, as Android's already is; c50d57cd section titles n/a (no Tuning Panel). Round 2: New Plus Menu: `ComposerControls.make(keepsSendVisible, isInCall)` (an empty composer keeps a dimmed Send; a call that owns the audio keeps Send instead of the hidden Call), `ComposerTrailingLabel` (**Android differs from iOS:** Send, Stop and Call share one 40 dp face that blends its colours and swaps its glyph when the control changes; empty, Send is a neutral face with a secondary arrow instead of iOS's disc at `emptySendOpacity` 0.3, which washed out on the white composer), `attachmentInset` 19, `attachmentRadius` 22, `attachmentResize` (0.4, 0), `Modifier.horizontalScrollEdgeFade` (iOS `HorizontalScrollEdgeFade`, 20 dp, 0.15 s). `ComposerChipButtonStyle` is the model chip's press (model picker). Sync b1c67259 (iOS 569e6f30, p217): doc-only on iOS (Plus Menu graduated); nothing to port. Sync e5c22780: the Call control's symbol is `phone.fill`. Sync dccec82e (da11bb99): `ComposerStopButton` moved to `ComposerCallControls.kt`. Sync 71e84d71 (d1a9e59f): `ComposerTunables.keyboardHorizontalMargin` = 8 (a constant; no tuning store). Sync ae029f85 (86ca6803, 6a173ff1, e16d3e8e): `ComposerLayoutMetrics.pickerTargetDrop` (iOS `ComposerLayout.pickerTargetDrop` = `innerVertical`): the pickers' 48 dp targets end at the glass's bottom edge; they already overhang the 44 dp row by 2 dp, so 4 dp. `composerTextReach` isn't added: Compose hits one point (no near-miss target expansion), so with the pickers lowered the gap between the text and the row is already the composer's own tap. Sync 440b77f0 (1385761f): `attachmentRadius(plusMenu)` is gone; every attachment uses `attachmentRadius` (22). Sync 01eef583 (0f24fbf3, 01eef583): `sendFade`/`attachmentResize` dropped: the folded control fades in on `swap` after `contentDelay`, the jump pill on `microIn`, the send label and the edge fades on `swap`. `keyboardFade` and `ComposerChipButtonStyle` (01eef583) don't exist on Android.Android-only (A-10): the composer never grows past the room between the status bar and the keyboard (the session's composer column caps its height), extending iOS's request-panel rule (docs/composer.md “The composer never grows past the header”, `requestPanelMaxHeight`, synced iOS ae029f85) to the plain composer, because Android phones rotate and run in short windows (split screen, freeform, a foldable's half); iOS phones are portrait-only (only iPad lists landscape), so iOS has no such cap. Short of room the header gives way first (the composer stands over it), then the field's six-line cap, down to one line (`ComposerLayout(inputLineHeight:)`; it scrolls), then the attachments, clipped from their top down to none (`ComposerFoldLayout`, `ComposerOverflowTop`); the control row never gives way. With room to spare nothing moves (portrait is pixel-identical). B-08: `JumpToLatestPill`'s empty slot takes no touches (iOS's empty frame isn't hit-testable): its `modifier` (the borrowed drag) wraps only the pill, so with the keyboard up a failed send's Retry under the hidden slot gets its tap. QA F-11 (iOS `allowsHitTesting(isShown)`, ComposerViews.swift:812): a leaving pill takes no touches either; the borrowed drag and its touch tracker are attached only while shown or while a finger that went down on it is still down (iOS `isDragging`), and the circle is a plain shadowed box, not an M3 `Surface` (which swallows touches). |
| `OpenCode/Session/DictationViews.swift` | 787 | `DictationViews.kt` | partial: the `dictationLevels` override (5c30a4c4) waits on the Welcome's animated story (settings), not ported | The bar's scope is `:feature:voice`'s `DotScopeView(DotScopeMode.Dictation(…))` fed by `:feature:composer`'s `DictationLevels`. DictationLabTriggers n/a (lab). `HoldToDictateButton`'s press is `:feature:composer`'s `Modifier.micPressGesture` (with `DictationHoldTracker`/`DictationDrag`/`MicPressCallbacks`), worn by the session mic in `SessionViewComposerControls.kt`; the session's duplicate pointer loop was removed. iOS `accessibilityHint`s are TalkBack click labels (Stop: “Puts the words in your message”; Send mid-run: Steer tap / Queue hold labels on `DeliveryMenu`). Sync 01eef583 (0f24fbf3): guides, the circle and the armed fill on `microIn`, the sent rise on `swap`; `DictationBarPresence(onLeft:)` reports the leave from the fade's completion (no 400 ms timer). Android divergence (QA F-59): the hints are TalkBack's click labels, read “Double-tap to …”, so they're verb phrases: Stop “Put the words in your message”, Send mid-run “Steer at the next step”. The bar's Stop and Send press and grow their glyph in and out of the spinner like the composer's face (`controlGlyphSwap`). |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1312,6 +1312,11 @@ fun HomeFeature.State.pushingSubagent(session: OpenCodeSession, reason: String?
SessionActivity.descendants(session.id, parent.familySessions).filter { it.id !in known },
)
if (detail.familyReadAt == null) detail = detail.copy(familyReadAt = parent.familyReadAt)
// Its tree's running jobs, until its own list answers.
if (detail.jobs.isEmpty()) {
val tree = detail.familySessions.mapTo(HashSet()) { it.id } + session.id
detail = detail.copy(jobs = parent.jobs.filterValues { it.ownerSessionID in tree })
}
if (!detail.hasLoadedPendingRequests) {
val members = detail.familySessions.mapTo(HashSet()) { it.id }
val forms = parent.formRequests.filter { it.sessionID in members }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,13 @@ internal fun HomeFeature.reduceServerEvent(state: State, event: OpenCodeServerEv
return Reduced(s, forwardToScreens(s, SessionFeature.Action.ShellEnded(event.shellID)))
}

is OpenCodeServerEvent.JobUpdated -> {
val snapshots = state.sessionSnapshots.mapValues { (_, snapshot) -> snapshot.applying(event.job) }
val s = if (snapshots == state.sessionSnapshots) state else state.copy(sessionSnapshots = snapshots)
// Each screen keeps the jobs of its own tree.
return Reduced(s, forwardToScreens(s, SessionFeature.Action.JobUpdated(event.job)) { it.session != null })
}

is OpenCodeServerEvent.ExecutionStarted -> {
val sessionID = event.sessionID
var s = state
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,7 @@ class SelectedTranscriptCancellationTests {
deleteSession = { _, _ -> },
sessionFamily = { _, _ -> awaitCancellation() },
runningShells = { _, _ -> awaitCancellation() },
runningJobs = { _, _ -> awaitCancellation() },
)
}

Expand Down
Loading
Loading