Skip to content

Aldo: a thread whose machine went to sleep mid-turn shows paused, not working; reconnect nudges no longer cut off a connection in progress - #185

Merged
logancsack merged 1 commit into
aldo/cloud-platformfrom
aldo/h9t35rycmk
Oct 9, 2026
Merged

logancsack merged 1 commit into
aldo/cloud-platformfrom
aldo/h9t35rycmk

Conversation

@logancsack

Copy link
Copy Markdown
Owner

This is the client half of logancsack/aldo's "Agents paused mid-turn stay paused, not 'working' forever".

Sidebar and home: "Paused mid-turn", not "Working" for hours

A thread whose machine went to sleep mid-turn kept its last shell, which says "working", so the sidebar showed it as working for 6–10 hours.

  • When it counts as asleep: Aldo's read says its machine is asleep or failed, and this page isn't connected to it.
  • Sidebar: such a thread with a turn on is now paused: "Paused mid-turn: open it to carry on", with a pause icon, grouped with the threads waiting on the user. Aldo's own "paused" state, from a newer Aldo, means the same.
  • Home: needsYouKind adds "Paused mid-turn". It isn't a decision: opening the thread resumes it, so aldoDecisions leaves it out, matching Aldo's brief.

Opening a thread took minutes: the nudge cut off the connection

While bringing a machine up, ensureAldoConnected (and followAldoMachine) sent retryNow every 8 seconds, whatever the connection was doing.

  • RetryRequested interrupts a connection being established (that has its own 15-second deadline), and drops one already connected.
  • So any attempt slower than 8 seconds, such as a big thread's first sync on a phone, was cut off and started over, again and again. A connection that came up right at a nudge was dropped.

Now only a connection that is waiting to try again gets a nudge (wantsNudge reads the supervisor's own phase: not connecting or connected).

Tested

  • tsgo --noEmit is clean.
  • vp lint has no findings in the changed files.
  • Aldo's client tests pass, 298 of them, including new cases for the paused sidebar rows (asleep, Aldo's "paused", stale read while connected, running) and for paused in needsYouKind and aldoDecisions.

The client pin is left to the "Client pin" routine.

🤖 Generated with Claude Code

… working; reconnect nudges no longer cut off a connection in progress

- Sidebar: a thread whose machine is asleep (Aldo's read, unless this page is
  connected to it) with a turn on is "Paused mid-turn: open it to carry on",
  with those waiting on the user, rather than "Working" for hours. Aldo's
  "paused" state (a newer Aldo) means the same.
- Home: "paused" needs the user ("Paused mid-turn"); it isn't a decision.
- Bringing a machine up, the 8-second "try again" nudge went to a connection
  even while it was connecting: an attempt slower than that (a big thread's
  first sync on a phone) was cut off and started over, again and again, and
  one just connected was dropped. Now only a connection waiting to try again
  is nudged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-09T06:01:36.969461Z 508875f PR opened
🔒 Security Review ✅ Completed 2026-10-09T05:57:48.347521Z 508875f PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 508875ff8f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +194 to +195
case "paused":
return "Paused mid-turn: open it to carry on";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Resume paused turns when opened

When the user has disabled Settings → preloading opened threads, this instruction is false: useAldoPreload computes enabled from settings.openedThreads and exits at preload.ts:110-117, so opening a cached paused thread never calls ensureAldoConnected and the turn remains paused. Paused mid-turn threads need to bypass that preload preference or offer an explicit resume action.

AGENTS.md reference: AGENTS.md:L73-L73

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Fixed in cfc7cf7. useAldoPreload wakes a thread whose machine went to sleep mid-turn when it's opened, whatever the preload setting, the same way it wakes a thread with nothing to show. Paused here means the directory has the machine asleep while a kept shell still says working or monitoring. So 'open it to carry on' holds with preloading off.

Comment on lines +88 to +90
const needsYou = boardFor(home.conversations, now).needsYou.filter(
(c) => !putAway(c, now) && needsYouKind(c) !== "paused",
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Include paused threads in phone waiting counts

On the phone layout, excluding paused conversations from aldoDecisions also excludes them from the Agents-tab badge and header summary, because AldoHome.tsx:337 and AldoAgentsTab.tsx:75 use aldoDecisions(...).length as their waiting count. Thus a paused thread appears inside the “Waiting on you” section while the tab reports no waiting items; keep it out of the decision walkthrough, but calculate those counts from all needs-you items.

AGENTS.md reference: AGENTS.md:L67-L70

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Fixed in cfc7cf7. A new aldoWaitingCount adds the decisions and the paused threads that aren't put away. The phone's badge (AldoHome) and the Agents tab summary use it. The walkthrough still goes through decisions only.

Comment on lines +39 to +40
// Its machine went to sleep mid-turn: opening the thread wakes it to carry on.
if (c.state === "paused") return "paused";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Render paused state at pending-form call sites

Returning paused as a needs-you kind sends it through UI branches that assume every truthy kind has a PendingForm: AldoPeek.tsx:208-214 renders a warning callout whose only content can be that form, while PendingForm returns null for paused, producing an empty bordered panel when the conversation has no summary; AldoLiveCard.tsx:163-166 similarly renders an empty container. Add paused-specific content/action or restrict those callouts to the form-backed kinds.

AGENTS.md reference: AGENTS.md:L67-L69

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Fixed in cfc7cf7. For a paused thread, PendingForm now shows 'Its machine went to sleep mid-turn.' with an 'Open to carry on' button. The callouts in the Peek and the live card are no longer empty.

Comment on lines +39 to +40
// Its machine went to sleep mid-turn: opening the thread wakes it to carry on.
if (c.state === "paused") return "paused";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Apply the asleep-machine fallback on the Home board

This recognizes only the newer literal state: "paused", not the state: "working", machine: "asleep" payload that the new sidebar test explicitly handles for older/stale Aldo reads. For that payload boardFor still places the conversation in working, so the Home board continues to show “Working now” indefinitely while the sidebar correctly says “Paused mid-turn”; use the same asleep/failed-machine predicate, with the same live-connection override, for Home classification.

AGENTS.md reference: AGENTS.md:L67-L70

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Fixed in cfc7cf7. A new isPausedMidTurn covers both Aldo's paused and an older read's working on a machine asleep or failed. needsYouKind, boardFor (paused leaves the working list), isStuck and aldoDecisions all use it. I left out the live-connection override on the home board: Aldo's read follows the directory within seconds of a wake, and threading the connection through every needsYouKind caller isn't worth it. The sidebar keeps the override, since its shells are live.

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.

1 participant