Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: anomalyco/opencode-android
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: dev
Choose a base ref
...
head repository: anomalyco/opencode-android
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: pin-sync
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 6 commits
  • 77 files changed
  • 1 contributor

Commits on Nov 26, 2026

  1. feat(drawer): sync pinned sessions through server spaces (experimental)

    Adds a generic spaces client in :server and, behind a new Drawer experiment
    "Sync Pinned Sessions" (off by default), syncs which sessions are pinned on a
    server through its `pins` space (key = session ID, value "1"). Pin order stays
    per device. With the experiment off nothing changes.
    
    Spaces client (`server/.../spaces/SpacesClient.kt`, pin-agnostic):
    - Per server and space: syncs every page from the saved cursor (a snapshot
      replaces, a delta applies, published once), then subscribes the event stream
      Home already reads from the last page's cursor. No second connection.
    - `server.connected`'s `data.stream` now follows `Connected` as
      `OpenCodeServerEvent.StreamOpened`; `experimental.space.updated/deleted/resync`
      decode to `SpaceUpdated/SpaceDeleted/SpaceResync`. Home forwards them.
    - A new stream or a resync syncs again from the saved cursor, then subscribes.
      Events newer than the sync apply; older ones are skipped.
    - A 404 marks the server as without spaces until its next stream: no retry loop.
    - set/delete show at once and stay pending until the server confirms them;
      pending writes go first on the next follow, and a sync or event doesn't undo
      them; a later write to a key replaces the earlier one.
    
    Pin sync (`feature/drawer/.../HomeFeaturePinSync.kt`):
    - Home follows the `pins` space from Task or when the switch turns on.
    - First sync for a server writes the pins only this phone had, then records the
      merge (`SharedKeys.pinSyncServerIDs`); from then on the space decides:
      removals unpin, additions pin at the end of the local order.
    - Any change to this server's pinned membership made here (toggle, drag, voice,
      deleted session) is written to the space; order changes aren't.
    - Switching the experiment off stops following and forgets every merge.
    
    The new title is translated by hand for all 56 languages (translate.py needs
    `opencode run`, which isn't available here).
    
    Verified: scripts/check.sh (assembleDebug, lintDebug, testDebugUnitTest for
    every module): BUILD SUCCESSFUL, 3786 tests, 0 failures, 3 skipped. New tests:
    SpacesClientTests (7), PinSyncTests (5); ExperimentalFeatureTests' Drawer list
    gains the new experiment. No emulator check (no UI change beyond the switch).
    opencode-agent[bot] committed Nov 26, 2026
    Configuration menu
    Copy the full SHA
    2de1fe7 View commit details
    Browse the repository at this point in the history
  2. fix(drawer): merge writes landing one by one no longer unpin

    On the emulator, turning Sync Pinned Sessions on merged the phone's pins into
    the space, but the space then showed the merge writes one at a time, and the
    intermediate state (missing a pin not yet written) unpinned it here and pinned
    it again at the end, changing the order. After the first emission, only what
    changed in the space since the previous one now applies; the first still makes
    the space the truth (pins removed elsewhere while the app was away go).
    
    Verified: scripts/check.sh (BUILD SUCCESSFUL, 3787 tests, 0 failures); new
    PinSyncTests.mergeWritesLandingOneByOneUnpinNothing; live check on an API 35
    emulator against an OpenCode dev server (merge keeps the order).
    opencode-agent[bot] committed Nov 26, 2026
    Configuration menu
    Copy the full SHA
    1d2bd21 View commit details
    Browse the repository at this point in the history
  3. feat(server): write spaces through the batch write endpoint

    The server replaced PUT/DELETE /api/experimental/space/:space/:key with
    POST /api/experimental/space/{space}/write ({changes: [{key, value|null}]},
    returning {revision, cursor}). The spaces client now has one `write(changes)`
    (null deletes) in place of set/delete:
    - all of a space's pending writes go in one request, split only past 1024
      changes or 1 MiB of values; a failed request keeps them pending as before;
    - a confirmed batch drops the pending entries it carried, and its cursor is
      saved when its revision follows straight on from what the space last saw
      (otherwise another client's change would be skipped by the next sync);
    - the space keeps the server's copy apart from the pending overlay.
    Pin sync writes each change, and the merge on enable, as one write.
    
    Verified: scripts/check.sh (BUILD SUCCESSFUL, 3788 tests, 0 failures);
    SpacesClientTests (8) and PinSyncTests (6) updated for the batch write.
    opencode-agent[bot] committed Nov 26, 2026
    Configuration menu
    Copy the full SHA
    a4c95a3 View commit details
    Browse the repository at this point in the history
  4. feat(server): sync and write spaces through the multi-space endpoints

    The server replaced GET /api/experimental/space/:space and
    POST /api/experimental/space/:space/write with POST .../space/sync
    ({spaces: [{space, cursor?}]} → {pages}) and POST .../space/write
    ({changes: [{space, key, value}]} → {spaces: [{space, revision, cursor}]}).
    
    - A new stream syncs every followed space of the server in one request (up to
      100); a space the shared 500-row budget didn't reach asks again with the same
      cursor, and pages with `next` continue.
    - Each page applies as it arrives: a delta at once, a snapshot's entries at
      once and the keys none of its pages held after its last page (no `next`, or
      the page before a delta), so nothing flickers away mid-snapshot. Mid-snapshot
      the saved cursor stays at the last whole snapshot or delta, so a reconnect
      restarts from there. A space shown for the first time waits for its whole
      first snapshot. Pending local writes still win.
    - Subscribe sends the synced spaces together (up to 100).
    - Writes carry their space; the confirm and cursor rules are unchanged.
    
    Verified: scripts/check.sh (BUILD SUCCESSFUL, 3791 tests, 0 failures);
    SpacesClientTests (11) cover paging under the row budget with a space left
    without a page, the snapshot sweep after its last page, an immediately applied
    delta, and the new write body.
    opencode-agent[bot] committed Nov 26, 2026
    Configuration menu
    Copy the full SHA
    38a3612 View commit details
    Browse the repository at this point in the history

Commits on Nov 27, 2026

  1. refactor(drawer): pin sync waits for a complete sync, not the spaces …

    …client
    
    The spaces client showed a space for the first time only once its whole first
    snapshot had arrived, a rule that belongs to pin sync. Now it always shows
    entries as each page arrives, the first sync included, and says whether the
    sync is complete: entries come as `SpaceEntries(entries, isSyncComplete)`,
    false from the start of a sync until it reaches its last page.
    
    Pin sync applies the space's additions at once (at the end, order kept) and
    does the merge and applies removals only once the sync is complete, diffing
    against the last complete view.
    
    Verified: scripts/check.sh (BUILD SUCCESSFUL, 3792 tests, 0 failures).
    SpacesClientTests: the first sync's partial page shows at once with
    isSyncComplete false; PinSyncTests.beforeTheSyncIsCompleteOnlyAdditionsApply:
    no merge and no unpin before the sync is complete, order kept.
    opencode-agent[bot] committed Nov 27, 2026
    Configuration menu
    Copy the full SHA
    3e3ff62 View commit details
    Browse the repository at this point in the history

Commits on Nov 30, 2026

  1. Merge remote-tracking branch 'origin/dev' into pin-sync

    # Conflicts:
    #	docs/parity/drawer.md
    #	docs/parity/server.md
    opencode-agent[bot] committed Nov 30, 2026
    Configuration menu
    Copy the full SHA
    8390c1b View commit details
    Browse the repository at this point in the history
Loading