Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
176aa3f
Show phones when a Bot is waiting on the person (provisional revision…
claude Nov 24, 2026
87797ca
Merge branch 'claude/project-thread-awyxuf-pr3b' into claude/project-…
claude Nov 24, 2026
20cbdf9
iOS Bots row keeps the approval line when the Bot needs you
claude Nov 24, 2026
43538d5
Merge branch 'claude/project-thread-awyxuf-pr3b' into claude/project-…
claude Nov 24, 2026
0c083ba
Merge branch 'claude/project-thread-awyxuf-pr3b' into claude/project-…
claude Nov 24, 2026
f569ff3
Merge branch 'claude/project-thread-awyxuf-pr3b' into claude/project-…
claude Nov 24, 2026
9522327
Merge branch 'claude/project-thread-awyxuf-pr3b' into claude/project-…
claude Nov 24, 2026
7baa700
Merge branch 'claude/project-thread-awyxuf-pr3b' into claude/project-…
claude Nov 24, 2026
3f7876f
Merge branch 'claude/project-thread-awyxuf-pr3b' into claude/project-…
claude Nov 24, 2026
3314ab9
Merge branch 'claude/project-thread-awyxuf-pr3b' into claude/project-…
claude Nov 24, 2026
1652811
Merge branch 'claude/project-thread-awyxuf-pr3b' into claude/project-…
claude Nov 24, 2026
be318fb
Merge branch 'claude/project-thread-awyxuf-pr3b' into claude/project-…
claude Nov 24, 2026
934f9aa
Merge branch 'claude/project-thread-awyxuf-pr3b' into claude/project-…
claude Nov 24, 2026
12fd02f
Fix argument order in the iOS needs-you inbox test
claude Nov 24, 2026
715bdfc
Merge branch 'claude/project-thread-awyxuf-pr3b' of https://github.co…
claude Nov 24, 2026
e097aea
Merge branch 'claude/project-thread-awyxuf-pr3b' into claude/project-…
claude Nov 24, 2026
cd7555c
Merge branch 'claude/project-thread-awyxuf-pr3b' of https://github.co…
claude Nov 24, 2026
85e3ca9
Keep the iOS needs-you home row fixture's Bots updated after they wer…
claude Nov 24, 2026
63dc127
Merge remote-tracking branch 'origin/claude/project-thread-awyxuf-pr3…
sambitcreate Nov 24, 2026
4bec5b6
Merge branch 'claude/project-thread-awyxuf-pr3b' into claude/project-…
claude Nov 24, 2026
d9d0339
Merge branch 'claude/project-thread-awyxuf-pr3b' into claude/project-…
claude Nov 24, 2026
1a18657
Merge branch 'claude/project-thread-awyxuf-pr3b' into claude/project-…
claude Nov 24, 2026
0fc1c61
Merge branch 'claude/project-thread-awyxuf-pr3b' into claude/project-…
claude Nov 24, 2026
8f22443
Merge remote-tracking branch 'origin/main' into claude/project-thread…
claude Nov 25, 2026
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
3 changes: 2 additions & 1 deletion .memory/bot-chat-activity.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,6 @@ If `main` has moved past 29, change every `30` D introduced to the next free rev
- PR 3 (desktop only, no revision): the desktop asks for `bot:cards`, `bot:access-requests` and `bot:plans` (each `own_call`, only when the host lists them) and answers them through new peer ops `botRespondRoutineProposal`, `botAnswerAccessRequest`, `botRespondPlan`. `remote-bot-session.ts` maps plan/access frames onto `snapshot.plan`/`accessRequest` (plan items get place ids; `revision` is a hash of what the card shows, so re-reading the same plan keeps the card mounted) and memory/routine entries onto local rows. `RemoteBotChatView` puts access and pending plan cards in the Needs-you slot, an active plan in the body, echoes sends at once (shared `BotPendingSend` helpers from bot-chat-pane) and shows a re-pair hint group for old pairings (`remoteBotGroups`). Host: `AidenRemoteBotService.list()` leaves out (and logs by id) a Bot whose summary fails the contract instead of failing the whole list (and the host feed); a transient summary read error fails the list so clients keep their last rows.
- PR 3 follow-up: `peerBotSessionCompat` dropped `accessRequest` and `plan` from session reads, so a reload lost the card; both are now kept (an unreadable one becomes null).
- PR 3b (Remote revision 67, provisional; re-claim at merge): `GET /bots/{botId}/session/entries?before=&limit=` (projector `olderEntries`, same audience as the snapshot; unknown `before` = 409 operation_stale) and `POST /bots/{botId}/queued/{submissionId}/withdraw` (needs `bot:activity`; routine/intro inputs read `gone`; runtime gained `withdraw`). No feature tokens: the server feature list is at its 32-token cap, so the desktop treats a 404 as an older host. Peer ops `botSessionEntries`, `botWithdrawQueued`; the follower's `loadOlder` + `carryOlderRemoteBotEntries` keep loaded pages across same-epoch snapshots. "Every waiting approval" was dropped: the next approval already follows each answer, and a count would need a new opt-in because phone approval decoders are strict.
- Still to come: PR 4 (phones show Needs you), PR 5 (headless server sends the same Bot signals). Not planned yet: a model picker for a remote Bot with a model problem (no remote route sets a Bot's model).
- PR 4 (2026-11-24, provisional revision 68, `bot:needs-you`): `GET /bots` summaries carry `needsYou: true` only for devices holding the opt-in (Android's Bot decoder rejects unknown keys). Router dependency `botNeedsYou(botIds)` reads `botLiveProjection().needsYou` (no transcript read); a failed read sends the list without it. iOS and Android ask for it alone; home rows read "Waiting for you" and stop showing as working, an approval the phone sees keeps "Needs your OK"; iOS inbox counts it. `aiden serve` doesn't wire it yet (PR 5).
- Still to come: PR 5 (headless server sends the same Bot signals). Not planned yet: a model picker for a remote Bot with a model problem (no remote route sets a Bot's model).

2 changes: 2 additions & 0 deletions android/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Aiden On The Go for Android. Earlier Android changes are recorded in the pull re

## Unreleased

- **2026-11-24 — Bots waiting on you (provisional Remote revision 68, `bot:needs-you`).** On a Mac that offers it, the app asks for `bot:needs-you` in a call of its own, after `stream:snapshot-reasons`. A Bot the Mac says waits on the person reads "Waiting for you" on its Bots row and is no longer shown as working; an approval the phone can see in the Bot's chat keeps "Needs your OK". `needsYou` decodes only as a JSON boolean and is never written back when false. Run `--tests '*AidenBotHomeBehaviorTest'`.

- **2026-11-24 — One before-effect refusal list, matching iOS.** Resume, Open work, Peers, Routine models, Watches and the generated avatar now share one list of refusals that prove a change never ran: the same 31 codes as iOS and `recognizedBeforeEffectCodes` in `protocol/aiden-remote/v1/fixtures/mutation-failure-ambiguity.json`. A first `409 revision_conflict` on any of them clears the pending attempt instead of keeping it as uncertain, as do `already_exists` and the handle, approval, question, memory, proposal, hand-off, access-request and plan-expiry refusals. An attempt whose earlier try was already unknown still stays uncertain whatever a later response says. Fork, Continue in a new chat and New worktree now follow the same cached-rejection-ledger rule as messages and run-now: a structured `5xx`, `408` or `429` keeps the request's key for the retry instead of spending it. No Remote wire or revision change.
- **2026-11-18 — Pairing with a server; Terminal theme control removed.** The pairing steps now say that on a server, `aiden serve` shows the code in its terminal, or `aiden remote pair lan` prints one, as iOS already did. The app no longer accepts the retired `appearance.terminalTheme` chat control, which no host has sent since the interactive CLI was retired on 2026-10-30. No Remote wire or revision change.

Expand Down
2 changes: 2 additions & 0 deletions android/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ On Macs at provisional Remote revision 61, the app negotiates `approval:cards`,

Hosts offering Remote revision 64's `chat:continue-in-new-chat` are asked for it alone. When a send is refused because the chat's workspace folder is missing on the computer and the host says the chat can continue elsewhere, the error under the composer gains **Continue in a new chat**. It opens a sheet listing the host's other workspaces, as the new-chat list names them, without the chat's own or archived ones and never with a folder path. Picking one copies the whole conversation into a new chat there and opens it; the original chat stays as it is. A failure shows the host's own sentence, and when the chosen workspace's folder is missing too the sheet can be opened again to pick another. A refusal without that offer, or from an older host, shows only the host's reason as before. Run `--tests '*AidenContinueInNewChatTest'` for its fixture, negotiation and chat flow coverage.

Hosts offering provisional Remote revision 68's `bot:needs-you` are asked for it alone. Their `GET /bots` summaries then carry `needsYou: true` for a Bot that waits on the person on that computer, and its Bots row reads "Waiting for you" instead of looking busy; an approval the phone can see keeps "Needs your OK". See "Bots that need you on phones, revision 68" in [`docs/aiden-remote-api-v1.md`](../docs/aiden-remote-api-v1.md).

For focused allowed-list and existing Bot regressions, use the installed JDK/SDK and offline Gradle from `android/`:

```sh
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2410,6 +2410,8 @@ class AidenBotSessionController(
*/
object AidenBotSessionCopy {
const val NEEDS_MODEL = "Needs an AI model"
/** Revision 68: an approval, a question, a hand-off or an open issue waits on the person. */
const val WAITING_FOR_YOU = "Waiting for you"
/** A reply that stopped before it finished (a quit, a crash, or a lifted pause). */
const val INTERRUPTED_ROW = "Interrupted — tap to resume"
/** Revision 37: the person paused the Bot (G2, the same words as iOS and desktop). */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,21 @@ data class AidenBotHomeRow(
val bot: AidenBotSummary,
val conversation: AidenBotConversationItem?
) {
/** A Bot waiting on the person (revision 68) isn't shown as working. */
val isWorking: Boolean
get() = bot.sessionState == AidenBotSessionState.RUNNING ||
(conversation != null && conversation.activityState != AidenBotConversationActivityState.IDLE)
get() = !bot.needsYou && (
bot.sessionState == AidenBotSessionState.RUNNING ||
(conversation != null && conversation.activityState != AidenBotConversationActivityState.IDLE)
)

/** The line under the name: what needs the person first, then the last message, then the subtitle. */
val preview: String
get() {
// Revision 68: the Mac says the Bot waits on the person. An approval this phone can
// see says more below, so it keeps its own line.
if (bot.needsYou && conversation?.activityState != AidenBotConversationActivityState.WAITING_FOR_APPROVAL) {
return AidenBotSessionCopy.WAITING_FOR_YOU
}
when (bot.sessionState) {
AidenBotSessionState.INTERRUPTED -> return AidenBotSessionCopy.INTERRUPTED_ROW
// Revision 37: a Bot the person paused (only `bot:handoffs` phones are told).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,13 @@ internal fun aidenShouldRequestChatContinueInNewChat(server: AidenServer, instal
internal fun aidenShouldRequestStreamSnapshotReasons(server: AidenServer, installation: AidenInstallation): Boolean =
aidenShouldRequestSoloCapability(AidenRemoteCapability.STREAM_SNAPSHOT_REASONS, server, installation)

/**
* Revision 68: a Mac that offers `bot:needs-you` in `serverCapabilities` is asked for it alone
* after `stream:snapshot-reasons`, unless [installation] already holds it.
*/
internal fun aidenShouldRequestBotNeedsYou(server: AidenServer, installation: AidenInstallation): Boolean =
aidenShouldRequestSoloCapability(AidenRemoteCapability.BOT_NEEDS_YOU, server, installation)

private fun aidenShouldRequestSoloCapability(
capability: AidenRemoteCapability,
server: AidenServer,
Expand Down Expand Up @@ -404,6 +411,24 @@ internal suspend fun aidenRequestStreamSnapshotReasons(
stillCurrent
)

/**
* Revision 68: asks [server] for `bot:needs-you` alone. A Mac that refuses it (400 or 404) leaves
* the pairing as it was; its Bot list then never says a Bot needs the person.
*/
internal suspend fun aidenRequestBotNeedsYou(
client: AidenRemoteClient,
server: AidenServer,
installation: AidenInstallation,
stillCurrent: () -> Boolean = { true }
): AidenSoloCapabilityNegotiation? =
aidenRequestCapabilitiesAlone(
if (aidenShouldRequestBotNeedsYou(server, installation)) {
listOf(AidenRemoteCapability.BOT_NEEDS_YOU)
} else emptyList(),
client,
stillCurrent
)

internal suspend fun aidenRequestBotMessaging(
client: AidenRemoteClient,
server: AidenServer,
Expand Down Expand Up @@ -828,10 +853,18 @@ class AidenRemoteCoordinator(
server = continueServer,
request = ::aidenRequestStreamSnapshotReasons
)
// Revision 68: `bot:needs-you` goes alone too.
val needsYouServer = negotiateSoloCapability(
generation = generation,
installation = installation,
client = newClient,
server = snapshotReasonsServer,
request = ::aidenRequestBotNeedsYou
)
// Revision 59: `bot:watches` goes alone, without another feature token.
val watchesServer = negotiateSoloCapability(
generation = generation, installation = installation, client = newClient,
server = snapshotReasonsServer, request = ::aidenRequestBotWatches
server = needsYouServer, request = ::aidenRequestBotWatches
)
val openWorkServer = negotiateSoloCapability(generation = generation, installation = installation,
client = newClient, server = watchesServer, request = ::aidenRequestBotOpenWork)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,15 @@ data class AidenBotSummary(
val issueCount: Int? = null,
@Serializable(with = InstantIso8601Serializer::class) val createdAt: Instant,
@Serializable(with = InstantIso8601Serializer::class) val updatedAt: Instant,
val revision: String
val revision: String,
/**
* Revision 68 (`bot:needs-you` devices only, on `GET /bots`): an approval, a question, a
* hand-off or an open issue waits on the person. The Mac sends it only as `true`; a missing
* flag reads as false and is never written back.
*/
@OptIn(ExperimentalSerializationApi::class)
@EncodeDefault(EncodeDefault.Mode.NEVER)
@Serializable(with = AidenStrictBooleanSerializer::class) val needsYou: Boolean = false
) {
init {
AidenBotWire.validateIdentifier(id, "id", AidenRemoteProtocol.MAX_BOT_IDENTIFIER_LENGTH)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,13 @@ data class AidenRemoteCapability(val rawValue: String) {
*/
val STREAM_SNAPSHOT_REASONS = AidenRemoteCapability("stream:snapshot-reasons")

/**
* Revision 68: `GET /bots` summaries carry `needsYou: true` for a Bot waiting on the
* person (an approval, a question, a hand-off or an open issue). It grants no authority.
* A Mac on an earlier revision refuses the name, so it is asked for alone.
*/
val BOT_NEEDS_YOU = AidenRemoteCapability("bot:needs-you")

val V1_KNOWN = listOf(
SERVER_READ, CHAT_READ, CHAT_WRITE, APPROVAL_RESPOND,
WORKSPACE_READ, WORKSPACE_BROWSE, WORKSPACE_MANAGE,
Expand Down Expand Up @@ -747,19 +754,22 @@ data class AidenRemoteCapability(val rawValue: String) {
/** Revision 65: negotiable when the Mac lists it in `serverCapabilities`, in its own call. */
val PHONE_STREAM_SNAPSHOT_REASONS = listOf(STREAM_SNAPSHOT_REASONS)

/** Revision 68: negotiable when the Mac lists it in `serverCapabilities`, in its own call. */
val PHONE_BOT_NEEDS_YOU = listOf(BOT_NEEDS_YOU)

/** Every grant `POST /device/capabilities` may add. */
val NEGOTIABLE = PROGRESS + PHONE_RUNS + PHONE_SIMULATORS + PHONE_BOT_CARDS + PHONE_BOT_ACTIVITY +
PHONE_BOT_HANDOFFS + PHONE_SCHEDULE_CARDS + PHONE_BOT_IMAGES + PHONE_BOT_ISSUES + PHONE_CHAT_JOBS +
PHONE_ATTACHMENTS_RAW + PHONE_CHAT_NEW_WORKTREE + PHONE_CHAT_CONTINUE_IN_NEW_CHAT +
PHONE_STREAM_SNAPSHOT_REASONS + PHONE_BOT_MESSAGING +
PHONE_STREAM_SNAPSHOT_REASONS + PHONE_BOT_NEEDS_YOU + PHONE_BOT_MESSAGING +
listOf(BOT_WATCHES, BOT_OPEN_WORK, BOT_ROUTINE_MODELS, BOT_PEERS, BOT_ACCESS_REQUESTS, BOT_PLANS, BOT_ALLOWED) +
BOT_UX

/** The pairing vocabulary plus the negotiable phone-scoped subsets. */
val PHONE_KNOWN = V1_KNOWN + PHONE_RUNS + PHONE_SIMULATORS + PHONE_BOT_CARDS + PHONE_BOT_ACTIVITY +
PHONE_BOT_HANDOFFS + PHONE_SCHEDULE_CARDS + PHONE_BOT_IMAGES + PHONE_BOT_ISSUES + PHONE_CHAT_JOBS +
PHONE_ATTACHMENTS_RAW + PHONE_CHAT_NEW_WORKTREE + PHONE_CHAT_CONTINUE_IN_NEW_CHAT +
PHONE_STREAM_SNAPSHOT_REASONS + PHONE_BOT_MESSAGING +
PHONE_STREAM_SNAPSHOT_REASONS + PHONE_BOT_NEEDS_YOU + PHONE_BOT_MESSAGING +
listOf(BOT_WATCHES, BOT_OPEN_WORK, BOT_ROUTINE_MODELS, BOT_PEERS, BOT_ACCESS_REQUESTS, BOT_PLANS, BOT_ALLOWED) +
BOT_UX
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class AidenBackgroundJobsTest {
* person stopped, or a reason this version does not know, reads as plain Stopped. */
@Test
fun aJobStoppedAfterTheChatWentQuietSaysSo() {
assertEquals(67, contract.getValue("contractRevision").jsonPrimitive.int)
assertEquals(68, contract.getValue("contractRevision").jsonPrimitive.int)
val list = contract.getValue("backgroundJobsChatSettled").jsonObject.getValue("list")
val decoded = AidenBackgroundJobs.decode(list.toString())
val labels = decoded.jobs.associate { it.id to AidenBackgroundJobCopy.status(it, start) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class AidenBotAccessRequestsContractTest {
private fun frame(element: JsonElement) = AidenBotSessionEventStream.decodeFrame(element.toString().toByteArray(), "bot_fixture_01")

@Test fun canonicalCardsSessionFramesIssuesAndLegacySettlement() {
assertEquals(67, root.getValue("contractRevision").jsonPrimitive.int)
assertEquals(68, root.getValue("contractRevision").jsonPrimitive.int)
assertEquals("bot:access-requests", fixture.getValue("capability").jsonPrimitive.content)
val folder = AidenBotAccessRequest.parse(fixture.getValue("folder"))
val mac = AidenBotAccessRequest.parse(fixture.getValue("wholeMac"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class AidenBotPlanContractTest {
assertNull(plan.items.first().used); assertNull(plan.items.first().max)
}
@Test fun canonicalSnapshotAndOrderedPlanFramesDecode() {
assertEquals(67, root.getValue("contractRevision").jsonPrimitive.int)
assertEquals(68, root.getValue("contractRevision").jsonPrimitive.int)
val session = wire.decodeFromJsonElement(AidenBotSession.serializer(), fixture.getValue("session"))
assertEquals(0L, session.seq)
assertHostFolderReview(requireNotNull(session.plan))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1618,7 +1618,7 @@ class AidenRemoteClientTest {
@Test
fun streamSnapshotReasonsDecodeSharedFixtureRejectInvalidReasonsAndNegotiateSolo() = runBlocking {
val fixture = contractFixture()
assertEquals(67, fixture.getValue("contractRevision").jsonPrimitive.int)
assertEquals(68, fixture.getValue("contractRevision").jsonPrimitive.int)
val section = fixture.getValue("streamRecovery").jsonObject
assertEquals("stream:snapshot-reasons", section.getValue("capability").jsonPrimitive.content)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package sbtbiswas.AidenOnTheGo.features.bots

import kotlinx.serialization.json.JsonObject
import kotlinx.serialization.json.JsonPrimitive
import kotlinx.serialization.json.jsonObject
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
Expand All @@ -17,7 +20,8 @@ class AidenBotHomeBehaviorTest {
name: String,
purpose: String = "",
updated: Instant = t0,
sessionState: AidenBotSessionState? = null
sessionState: AidenBotSessionState? = null,
needsYou: Boolean = false
) = AidenBotSummary(
id = id,
name = name,
Expand All @@ -28,7 +32,8 @@ class AidenBotHomeBehaviorTest {
paused = sessionState == AidenBotSessionState.PAUSED,
createdAt = t0.minusSeconds(86_400),
updatedAt = updated,
revision = "r1"
revision = "r1",
needsYou = needsYou
)

private fun chat(
Expand Down Expand Up @@ -131,6 +136,33 @@ class AidenBotHomeBehaviorTest {
)
}

@Test
fun aRunningBotTheMacSaysWaitsOnThePersonSaysSoInsteadOfLookingBusy() {
val waiting = bot("b", "Scout", sessionState = AidenBotSessionState.RUNNING, needsYou = true)
val running = AidenBotHomeRow(waiting, chat("c", "b", "Checking the build", state = AidenBotConversationActivityState.RUNNING))
assertEquals(AidenBotSessionCopy.WAITING_FOR_YOU, running.preview)
assertFalse(running.isWorking)
// An approval this phone can answer keeps its own, more useful line.
assertEquals(
"Needs your OK",
AidenBotHomeRow(waiting, chat("c", "b", "old", state = AidenBotConversationActivityState.WAITING_FOR_APPROVAL, canRespond = true)).preview
)
// Without the flag the same Bot still reads as busy.
assertTrue(AidenBotHomeRow(bot("b", "Scout", sessionState = AidenBotSessionState.RUNNING), null).isWorking)
}

@Test
fun needsYouDecodesOnlyAsABooleanAndIsNeverWrittenWhenFalse() {
val wire = AidenBotWireJson.json
val plain = wire.encodeToJsonElement(AidenBotSummary.serializer(), bot("b", "Scout")).jsonObject
assertFalse("needsYou" in plain)
assertFalse(wire.decodeFromJsonElement(AidenBotSummary.serializer(), plain).needsYou)
assertTrue(wire.decodeFromJsonElement(AidenBotSummary.serializer(), JsonObject(plain + ("needsYou" to JsonPrimitive(true)))).needsYou)
assertTrue(runCatching {
wire.decodeFromJsonElement(AidenBotSummary.serializer(), JsonObject(plain + ("needsYou" to JsonPrimitive("true"))))
}.isFailure)
}

@Test
fun activityDotShowsOnlyWhileTheBotIsBusy() {
val scout = bot("b", "Scout")
Expand Down
Loading
Loading