Skip to content

Fix app gaps the scenario harness reproduced - #715

Merged
ivanfenenko merged 2 commits into
mainfrom
fix/scenario-harness-app-gaps
Oct 17, 2026
Merged

ivanfenenko merged 2 commits into
mainfrom
fix/scenario-harness-app-gaps

Conversation

@ivanfenenko

@ivanfenenko ivanfenenko commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes four gaps the scenario harness (PR #714) reproduced against real opencode v1 1.19.1 and v2 dev. Each fix ships on both apps and stays behind the domain adapters (no v1/v2 UI fork).

Closes #619

What changed

Gap Fix
v2 patch tool showed a generic "Called patch" row patch maps like v1 apply_patch: Patch row, file count, per-file +/− from metadata.files
Session deleted by another client stayed open in Session Chat EventDomainAdapter.sessionDeletedID (v1 carries the id only in info.id, v2 sends sessionID); SessionInfo requests leave, so the chat returns to Home
After an event-stream 401 the apps stopped retrying and stuck on "Authentication failed" 401/403 is no longer terminal: the lease shows "Authentication failed" and retries on a slower backoff (5, 10, 20, then 30s, ±25% jitter) until it reconnects, which also publishes a reconnect so screens refetch. Pull-to-refresh and foreground cut the wait short; iOS start() no longer refuses after an auth failure
Revert from another client was not reflected (iOS nothing, Android only a banner; v2 staged hidden inconsistently) EventDomainAdapter.sessionRevertUpdate reads v1 session.updated info.revert and v2 session.revert.staged / cleared / committed. Session Chat Commands owns the boundary; the timeline hides the boundary message and later turns while a revert is pending and shows the revert chip. Clearing restores them; commit keeps today's truncate

The harness's fifth gap (a subagent's ask not reaching the parent) does not reproduce on main: both apps show the child's approval card in the parent and child chats on v1 and v2. The Home "Needs approval" roll-up for child asks only applies to t3-experiment (#345) and is left for a separate change there.

Verification

  • Unit tests: new cases for each fix on both platforms (adapter parsing, timeline Patch row, SSE policy/backoff and stream recovery, Session Chat leave on delete, live revert hide/restore). Full suites pass: Android testDebugUnitTest, iOS OpenCode MobileTests (2038 tests).
  • Device, via the scenario harness on v1 and v2, iOS simulator and Android emulator:
    • tool-patch-multifile (v2): Patch · 3 files +3 −5 on both apps
    • session-deleted-from-outside: chat returns to Home, row gone, on both apps and protocols
    • sse-auth-error-no-hot-loop: "Authentication failed" during the 30s window, one attempt per backoff step, back to live 30–40s after auth recovers, on both apps and protocols
    • revert-from-outside (+ clear variant): turns 2–3 hidden with the revert chip, restored on clear, on both apps and protocols

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith with what you need.

Both apps, both protocols, behind the domain adapters:

- v2 `patch` tool renders as a Patch row with per-file counts, like v1 `apply_patch`.
- A session deleted by another client closes its open Session Chat (v1 carries the id only in `info.id`).
- An event-stream 401/403 no longer stops retries: it shows "Authentication failed" and retries on a slow
  backoff (5, 10, 20, then 30s) until a lease reconnects; pull-to-refresh and foreground retry now.
- A pending revert from any client (v1 `session.updated` info.revert, v2 `session.revert.staged`) hides
  the reverted turns live and shows the revert chip; clearing brings them back (#619).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@ivanfenenko ivanfenenko left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Nice set of fixes. The 401/403 change in particular is a clear improvement: the stream now shows AuthFailed but keeps retrying on a slower 5–30s backoff, foreground and pull-to-refresh cut that short, and both platforms got tests for the recovery path. The session-deleted handling and the v2 patch tool chrome look good and match across Android and iOS.

One thing I'd fix before merging, inline below: on a v2 server, a session rename clears a pending revert on this device.

A v2 `session.renamed` is projected as a `session.updated` with a partial `info`
(id and title only), which read as "no revert pending" and cleared the boundary
while the server still had the revert staged. Only a full session `info` (with
`time`, as v1 always sends) is read as a revert snapshot now.

Also splits an over-long line in the Android timeline projection.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ivanfenenko
ivanfenenko merged commit 9ef927b into main Oct 17, 2026
@ivanfenenko
ivanfenenko deleted the fix/scenario-harness-app-gaps branch October 17, 2026 15:21
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.

OPE-189: Truncate Session Chat live when a turn is reverted

1 participant