Skip to content

Load older messages and remove a queued message in a paired Mac's Bot chat - #910

Open
sambitcreate wants to merge 20 commits into
claude/project-thread-awyxuf-pr3from
claude/project-thread-awyxuf-pr3b
Open

sambitcreate wants to merge 20 commits into
claude/project-thread-awyxuf-pr3from
claude/project-thread-awyxuf-pr3b

Conversation

@sambitcreate

@sambitcreate sambitcreate commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

Requested by sbt · project thread

Stacked on #909 (which is stacked on #907 and #895). Merge those first; GitHub then retargets this PR.

Problem

In a paired Mac's Bot chat:

  • Only the newest 200 entries showed. There was no way to see earlier messages.
  • A message queued while the Bot was busy had no Remove, unlike a local Bot chat. The Remote protocol had no route to take one back.

Change

PR 3b of the fix plan.

Remote protocol, revision 67 (provisional; re-claim the next free number at merge, after #907's 66).

  • GET /bots/{botId}/session/entries?before=&limit= (getBotSessionEntries, bot:read + chat:read): the entries just older than one the device holds, oldest first. The page uses the same projection as the device's session, fits its byte limit, and has a truthful hasOlder. A before the session doesn't hold is 409 operation_stale.
  • POST /bots/{botId}/queued/{submissionId}/withdraw (withdrawBotQueuedMessage, needs bot:activity, keyed): withdrawn, started or gone. A routine's input or the self-intro reads gone, because it isn't the person's to take back.
  • No feature tokens. The server feature list is already at its 32-token cap for Macs and phones, so the desktop treats a 404 as an older host.
  • iOS and Android contract asserts move to 67. Phones don't use the routes yet.

Host.

  • The projector's olderEntries and the session service's olderEntries / withdrawQueued.
  • The Bot session runtime gains withdraw. It is the same BotSessionService.withdraw the desktop's own Remove uses.

Desktop client.

  • Peer operations botSessionEntries and botWithdrawQueued. Unreadable entries in a page are dropped, as in the session.
  • The follower's loadOlder places a page before what is shown. A reconnect snapshot of the same epoch keeps the loaded pages; a new epoch drops them.
  • The remote Bot chat shows Load older messages, the same control a remote workspace chat uses. Queued rows get the shared Remove.
  • An older host shows "Older messages are on . Update Aiden there to see them here." For Remove, it says to update Aiden there.

Dropped from the plan: a count of every waiting approval. The next approval already appears after each answer. A count would need a new key on the approval, and phones' approval decoders refuse unknown keys, so it would also need a new opt-in.

Docs:

  • docs/aiden-remote-api-v1.md: new "Bot chat pages and queued messages, revision 67" section.
  • docs/aiden-on-the-go-remote-access.md: Bots bullet.
  • .memory/bot-chat-activity.md.

Screenshots

Scout on the Studio is running, with one message queued and earlier messages on the host.

Before (#909) After After Load older
Light
Dark

Scope

A feature (PR 3b of the stack). Still to come: Needs you on phones (PR 4), and the same Bot signals from the headless server (PR 5). The headless server builds the same session service; PR 5 checks what it serves.

Verification

  • npm run type-check: clean. eslint on the touched files: clean.
  • Suites:
    • test:remote-chat (254): pass.
    • test:peer-hosts (186): pass.
    • test:bots (5 + 11 + 1083): pass.
    • test:sidebar (260): pass.
    • test:aiden-remote minus aiden-remote-service.test.ts (which needs IPv6, missing in the cloud container): pass after one fix. A session-equivalence test caught a cursor difference; the cursor is now kept only while hasOlder. That file reruns at 140/140.
  • New behavioral tests:
    • Host: paging back from the session's oldest entry reaches the start of a 260-message chat in order with no repeats. An unknown cursor is stale and a bad limit is refused.
    • With the real Bot runtime: a queued message withdrawn while a turn runs never joins the chat, and a repeat replays the receipt. A routine's queued input reads gone and still runs.
    • Router: query validation, the Idempotency-Key requirement, and the grant checks (chat:read for pages, bot:activity for withdraw).
    • Protocol: parsers plus the OpenAPI schemas for both shapes.
    • Peer operations: routes, bodies, and reading a newer host's page.
    • Follower: pages, a reconnect keeping them, a new epoch dropping them, 404 versus 409.
    • Chat view: Load older and Remove, each against current and older hosts.
  • A follow-up commit on Answer a paired Mac's Bot's plans, folder requests and routine ideas here #909 (9c56084) keeps a plan or folder card when the remote chat is read again. Before, a reload dropped the card until the next stream snapshot.
  • Screenshots come from a temporary Playwright Electron spec under xvfb with mocked peer-host IPC. The spec is not committed.

AI disclosure

Written with Claude Code.

Checklist

  • I tested these changes locally and reviewed the diff myself
  • Related docs / tests are updated where behavior, settings, or contracts changed
  • No unrelated refactors or changes are included

Android CI flake fixed in this branch

  • Spec: AidenBrowserRecordingOwnershipUiTest.replacingCardReleasesOldDeliveryAndOwnsTheNextOne. The test is on main and flakes there too; nothing in this PR's feature work touches the recording card. This branch carries a test-only fix for it (below) because the flake kept failing this PR's "Android build and APK" job. The production recording code is unchanged.
  • Symptom: a bare AssertionError from eventually (the file was never released) in "Android build and APK" on cfac9e5: https://github.com/sambitcreate/aiden-agent/actions/runs/45362691722/job/138337222924
  • Cause: the Compose test rule's unconfined dispatcher let the card adopt its file on the download worker thread. That raced the main-thread disposal. On a device the card resumes on the main thread.
  • Fix: 542d584 and 73ab980 change only the test. Its load now continues on the main thread through a hop that always suspends and is resumed by a posted main-thread task. A withContext(Dispatchers.Main) {} hop (f68566c) was tried and does not hold: with the same probe, 10 of 13 adopts still ran on the worker. A temporary pause in adopt when it ran off the main thread reproduced the symptom in 4 of 6 cases before the fix and 0 of 18 after it. The full connectedDebugAndroidTest suite (212 tests) passes on a headless API 36 AVD.

Generated by Claude Code

…Bot chat

Remote revision 67 (provisional) adds two Bot session routes: a page of
entries older than one the device holds, projected like its session, and
a withdraw for one of the person's queued messages (bot:activity holders;
a routine's input or the self-intro reads as gone). No feature tokens, as
the server list is full: the desktop treats a 404 as an older host.

The remote Bot chat shows Load older messages while the session has
older entries, keeps loaded pages across a reconnect of the same epoch,
and gives queued rows the same Remove as a local chat.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018VA6REg8PpdXdPfTkkCKZJ
@sambitcreate sambitcreate self-assigned this Nov 24, 2026

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Important

The new routes need stronger ownership and pagination fencing before merge; the current implementation can withdraw non-person work or leave remote history stale/unreachable.

Reviewed changes across the complete initial diff for the Remote Bot transcript paging and queued-message withdrawal feature.

  • Remote protocol and host adds revision 67 page/withdraw DTOs, OpenAPI routes, grant checks, projector paging, runtime withdrawal, and idempotent receipts.
  • Peer bridge and renderer adds validated peer operations, forward-compatible page parsing, follower paging state, same-epoch page retention, and Load older/Remove controls with old-host fallbacks.
  • Cross-platform contracts and docs advances the shared fixture revision for iOS and Android and documents the new desktop-only behavior and compatibility contract.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using GPT Sol | 𝕏

…hread-awyxuf-pr3b

# Conflicts:
#	docs/aiden-on-the-go-remote-access.md
#	renderer/main/remote-bot-chat-view.test.tsx

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Important

No new issues were introduced by this merge delta. The three required findings from the prior Pullfrog review remain unchanged and open.

Reviewed changes since the prior Pullfrog review, covering the updated stacked base and its interaction with this PR's Bot session paging.

  • Merged the updated stacked base — incorporated the latest remote Bot behavior and documentation into the feature branch without changing the previously reviewed paging or withdrawal paths.
  • Hardened remote unread tracking — moved remote Bot seen state fully into the host clock domain and now clears a dot only when the session view displays the feed's latest reply.
  • Extended behavioral coverage — verified that an older session snapshot keeps a newer feed reply unread, while a displayed reply clears it.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | Fix it ➔ | View workflow run | Using GPT Sol | 𝕏

…with the abort

- Taking back a queued message checks whose message it is inside the Bot's
  lane, with the abort, so a request racing a routine's send never takes
  the routine's input.
- A same-epoch snapshot can mean the host removed or reordered entries, so
  older pages kept across it are read again and replaced (or dropped if
  that fails), and a page asked for before a snapshot is never placed.
- A page whose oldest entries this Mac can't show still moves Load older
  past them: the host supervisor returns the host's own oldest entry as the
  next cursor.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018VA6REg8PpdXdPfTkkCKZJ

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Important

Snapshot reconciliation still loses part of an already loaded transcript after enough pages have been fetched.

Reviewed changes since the prior Pullfrog review, covering the fixes for queued ownership and transcript pagination fencing.

  • Serialized queued ownership — moved person-only provenance inspection into the Bot runtime's per-Bot withdrawal lane so routine and self-introduction submissions cannot be aborted by a racing remote request.
  • Advanced filtered pages — preserved the host's oldest raw entry ID independently of entries this Mac can parse, allowing all-unknown pages to move pagination forward.
  • Reconciled same-epoch snapshots — invalidated pages requested against an earlier shown history and re-read carried prefixes after snapshots, with one remaining boundary issue inline.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using GPT Sol | 𝕏

…a time

A same-epoch snapshot re-read only one 200-entry page and then dropped the
rest of the loaded history. Read pages until every kept entry is covered,
and keep the pages read so far if a later one fails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018VA6REg8PpdXdPfTkkCKZJ

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Important

Multi-page reconciliation is still not bounded to the carried transcript when a newer host sends entry kinds this client filters out.

Reviewed changes since the prior Pullfrog review, covering the fix for carried Bot history longer than one host page.

  • Paged snapshot reconciliation — Re-read carried history in bounded pages until its visible entry count is covered, retaining completed pages when a later request fails.
  • Extended behavioral coverage — Added unchanged-history, oldest-entry rewrite, and partial-failure cases for a 300-entry carried prefix.
  • Updated the Remote contract guide — Documented bounded multi-page reconciliation and partial-read behavior.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using GPT Sol | 𝕏

Bound the re-read by the entries the host sent, read or not, so pages of
entry kinds this Mac filters out can't walk it past the kept range.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018VA6REg8PpdXdPfTkkCKZJ

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Important

Raw host-entry accounting now prevents reconciliation from reading beyond the old range, but it can discard compatible messages that were already loaded when newer entry kinds are interleaved.

Reviewed changes since the prior Pullfrog review at e8c218b58, covering the forward-compatibility accounting fix for same-epoch Bot history reconciliation.

  • Counted raw host entries — Added an internal hostCount alongside the raw cursor before peer compatibility filtering removes entry kinds this Mac cannot read.
  • Bounded snapshot reconciliation — Switched the reread completion count from retained entries to raw host entries so unknown pages cannot walk beyond the intended boundary.
  • Extended mixed-version coverage — Added peer and follower cases for mixed and all-unknown pages, including the cursor used by the next Load older request.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using GPT Sol | 𝕏

…n it covered

Track how many host entries the loaded pages spanned (drawn or not) and
re-read until the oldest kept entry, or that span if the host dropped it, so
messages older than entries this Mac can't show stay after a snapshot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018VA6REg8PpdXdPfTkkCKZJ

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Important

Snapshot reconciliation still miscounts carried history when compatibility filtering changes the snapshot boundary.

Reviewed changes since the prior Pullfrog review at 9ff30540a, covering the raw-span reconciliation fix.

  • Tracked the loaded host span — Added separate visible-entry and raw-host counters so filtered page entries no longer shorten the stable-boundary reread.
  • Stopped at the retained boundary — Rereads now stop at the oldest retained visible entry, falling back to the recorded raw span when that entry disappeared.
  • Extended mixed-version coverage — Updated the newer-host test to preserve compatible entries across an unchanged same-epoch snapshot and bound a deletion reread.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using GPT Sol | 𝕏

When a same-epoch snapshot moves into the loaded range, read until the oldest
kept entry and drop anything older the pages brought, so what was shown stays
and nothing older is added; the span is only a bound when that entry is gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018VA6REg8PpdXdPfTkkCKZJ

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Important

The ID-anchored reread still has a finite fallback that can drop already loaded messages across a large compatibility-filtered snapshot gap.

Reviewed changes since the prior Pullfrog review at 17dd2104d, covering the follow-up for shifted mixed-version snapshot boundaries.

  • Anchored reconciliation — Continued rereading until the oldest retained visible entry is found and trimmed any entries fetched beyond that anchor.
  • Bounded missing-anchor fallback — Added a span + carried traversal budget for cases where the host no longer has the oldest retained entry.
  • Extended coverage and docs — Added a shifted-boundary mixed-version case and documented trimming and fallback behavior.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using GPT Sol | 𝕏

When the oldest kept entry is deleted, cut the re-read back to the
earliest surviving kept entry and resume Load older from it, instead of
adding history the person had not loaded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018VA6REg8PpdXdPfTkkCKZJ
A newer host's unshown entries can make the gap between kept entries
larger than the bounded re-read. When the bound runs out first, ask the
host whether it still has the oldest kept entry, then each later one, and
read on to the earliest it has, so shown messages are not dropped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018VA6REg8PpdXdPfTkkCKZJ

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Important

Same-epoch reordering can still remove a surviving loaded message during reconciliation.

Reviewed changes since the prior Pullfrog review at 805f572fc, covering the retained-boundary trim added for missing older entries.

  • Trimmed missing-anchor rereads — Cut a bounded reread back to the earliest retained entry it reached and resumed Load older from that surviving entry.
  • Extended deletion coverage — Verified that dropping the oldest retained entry keeps the next retained message and can still page to older host history.
  • Updated the Remote contract guide — Documented the surviving-entry trim and resumed paging behavior.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using GPT Sol | 𝕏

The host may reorder kept entries within the same epoch, so the re-read
is cut at whichever kept entry comes first in its current order rather
than in the order this Mac showed them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018VA6REg8PpdXdPfTkkCKZJ
A rewrite that removed every kept entry no longer costs one request per
loaded entry: after 8 gone the bounded re-read stands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018VA6REg8PpdXdPfTkkCKZJ

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Important

Same-epoch reconciliation can still drop a surviving loaded message when a reorder moves it across a page or compatibility-filtered boundary.

Reviewed changes since the prior Pullfrog review at e8eea7698, covering the retained-anchor and host-order reconciliation repairs.

  • Probed surviving anchors — Continued past the bounded reread by checking retained IDs and reading through arbitrarily large compatibility-filtered gaps.
  • Selected host-order boundaries — Trimmed reread history at the first retained entry in the host's current order instead of its previous order.
  • Expanded reconciliation coverage — Added shifted-gap, deletion, and reducer-level reorder cases for retained Bot history.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using GPT Sol | 𝕏

Reaching the oldest kept entry no longer ends a re-read while another
kept entry is still unread: the host is asked about it (within the same
8-entry budget) and reading goes on to it, so a reordered entry isn't
dropped. Test hosts answer operation_stale for ids they don't have, as
the real host does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018VA6REg8PpdXdPfTkkCKZJ

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Important

The retained-ID probing still has a bounded case that can remove history already visible to the user.

Reviewed changes since the prior Pullfrog review at b646dab76, covering the retained-entry reconciliation follow-up.

  • Bounded retained-ID probing — Added one-entry existence probes for retained entries missed by the normal reread, capped at eight per reconciliation.
  • Cross-boundary rereads — Continued paging through compatibility-filtered gaps until each successfully probed retained entry is fetched.
  • Behavioral documentation and coverage — Documented the probe budget and added follower cases for an all-removed prefix and a retained entry moved farther back.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using GPT Sol | 𝕏

After 8 questions with kept entries still unaccounted for, the loaded
part is dropped and Load older starts again from the snapshot, instead
of showing a partial re-read that may miss entries the host kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018VA6REg8PpdXdPfTkkCKZJ

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes since the prior Pullfrog review at 3333387c4, covering the retained-history probe-exhaustion fix.

  • Reset exhausted reconciliation — Changed the eight-probe limit to discard the loaded prefix and resume from the fresh snapshot instead of publishing a partial reread with unresolved retained entries.
  • Covered surviving entries beyond the budget — Added a follower case where earlier retained IDs are stale while later survivors remain beyond a large compatibility-filtered gap.
  • Documented the fallback — Updated the Remote contract guide to state that unresolved loaded pages are dropped when the fixed probe budget expires.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | View workflow run | Using GPT Sol | 𝕏

Copy link
Copy Markdown
Owner Author

Two failures on cfac9e5, both outside this PR's diff:

  • Android build and APK: AidenBrowserRecordingOwnershipUiTest.replacingCardReleasesOldDeliveryAndOwnsTheNextOne failed on the emulator with a bare AssertionError (1 of 212). This PR changes only the Remote revision number in Android sources, so it can't affect browser-recording cards. Job log.
  • Desktop tests (renderer-other): packages/cli/tests/server-visuals.test.mjs "an installed browser draws a chart offline…" hit its 15 s render limit on a cold Chrome launch. It fails the same way on every branch in this stack, and Warm up Chrome before the timed server-visuals render test #914 fixes it separately. Job log.

I'll rerun the failed jobs once when the run finishes. If either fails again, I'll record it in the PR description.


Generated by Claude Code

The Compose test rule runs composition coroutines on an unconfined
dispatcher, so the card's Play continuation adopted its file on the IO
worker that finished the download. The test's main-thread sync did not
wait for it, and a disposal could land between adopt's disposed check
and its owned assignment, leaving the file unreleased. That surfaced as
a bare AssertionError from eventually in
replacingCardReleasesOldDeliveryAndOwnsTheNextOne on CI.

The test's load now hops back to the main thread, as the card does on
a device, with a hop that always suspends and ignores cancellation so
late delivery after disposal is still covered. App code is unchanged.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Important

The Android test-harness follow-up introduces an unsafe continuation race that should be fixed before merging.

Reviewed changes since the prior Pullfrog review at cfac9e5cb, focused on the Android recording-ownership test follow-up.

  • Moved mocked recording delivery to the main thread — Added a posted continuation handoff before the card adopts a downloaded recording.
  • Recorded the hosted-test diagnosis — Documented the unconfined Compose test dispatcher race and the intended canceled late-delivery coverage.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using GPT Sol | 𝕏

claude and others added 2 commits November 24, 2026 11:03
… test

Resuming the raw continuation from a main-thread post could run it
before the download thread had returned COROUTINE_SUSPENDED. withContext
handles a resume that races the suspension, and NonCancellable keeps the
late-delivery-after-disposal case.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018VA6REg8PpdXdPfTkkCKZJ
…p test

The withContext(Dispatchers.Main) {} hop from the previous commit does
not keep the card on the main thread. The empty block usually finishes
on main before the download thread suspends, so that thread takes the
result and carries on. With a pause in adopt whenever it ran off the
main thread, 10 of 13 adopts were on the worker and 3 or 4 of the 6
cases failed on each run.

The hop now always suspends and is resumed only by the posted
main-thread task. With the same probe, 15 of 15 adopts ran on main and
all cases passed. Resuming while the worker is still returning
COROUTINE_SUSPENDED is the ordinary dispatcher handoff.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Important

The Android test-harness fix still does not guarantee main-thread continuation, so the hosted ownership race can remain.

Reviewed changes since the prior Pullfrog review at 542d584d6, focused on the follow-up for the Android recording-ownership test.

  • Replaced the raw continuation handoff — Switched the posted unintercepted-continuation resume to nested withContext(NonCancellable) and withContext(Dispatchers.Main) calls.
  • Retained canceled-delivery coverage — Kept cancellation disabled while attempting to return the mocked download to Main so a disposed owner still receives and releases late files.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using GPT Sol | 𝕏

…' into claude/project-thread-awyxuf-pr3b

# Conflicts:
#	.memory/bot-chat-activity.md

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes since the prior Pullfrog review at f68566c49, including the updated stacked base and the Android ownership-test follow-up.

  • Restored the deterministic Main-thread handoff — Replaced the ineffective empty withContext(Main) hop with an always-suspending posted resume through the intercepted continuation, preserving canceled late-delivery coverage while returning adoption to Android Main.
  • Merged the updated stacked base — Carried forward the remote Bot unread-baseline, stable plan-card revision, and host-feed documentation updates without changing this PR's paging or withdrawal guarantees.
  • Recorded the test diagnosis — Updated project memory with the failed alternative, probe results, and the final test-only behavior.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | View workflow run | Using GPT Sol | 𝕏

…hread-awyxuf-pr3b

# Conflicts:
#	docs/aiden-remote-api-v1.md

This branch has not been deployed

No deployments
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.

2 participants