fix(agents): start new agents on Create and make their status clear - #332
salman1993 wants to merge 5 commits into
Conversation
Create now saves, starts, then publishes the agent's profile, with a per-step retry that never creates another identity. Card Start/Stop failures re-read status and report the host's reason instead of leaving an unconfirmed page-level error. Control failures carry the host's sanitized reason as Error.cause, so the dialog and cards no longer parse the combined message text, and the reason is punctuated before the unconfirmed-status guidance. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Salman Mohammed <smohammed@squareup.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8c85ad73da
ℹ️ 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".
| if (!control.publishProfile) | ||
| throw new Error( | ||
| "Profile setup is unavailable. Rebuild the desktop app.", | ||
| ); |
There was a problem hiding this comment.
Avoid offering an impossible profile retry
When the connected desktop host supports creation but does not expose publishProfile, this branch throws a plain Error, but the catch path reads only Error.cause through agentFailureReason. Consequently, it discards the actionable rebuild message, displays “Select Finish profile to try again,” and leaves that button enabled even though every click must encounter the same missing capability. Preserve this local error and direct the user to rebuild or close rather than offering a retry until profile publication is available.
AGENTS.md reference: AGENTS.md:L83-L86
Useful? React with 👍 / 👎.
The Agents panel now says its statuses may be out of date instead of describing the last host snapshot as unconfirmed. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Salman Mohammed <smohammed@squareup.com>
wesbillman
left a comment
There was a problem hiding this comment.
Star Lord automated source review
Published by Star Lord via Wes's GitHub account (wesbillman).
- Head:
b8e290f99077f12c68a797a4208214f590121c6d - Base / merge base:
85d6bf82c54d1c8d930d58444597a1fe31cc8975 - Disposition: one actionable P2 finding, inline: a superseded card failure notice can return after a later successful Start/Stop cycle. This is a non-blocking
COMMENTreview, not approval or a changes-requested review.
Reviewed the complete eight-file diff, Create → Start → profile and same-identity retries, close/unmount continuation, refresh/generation and recovery-Stop behavior, card/editor callers, native command outcomes, and relevant test/documentation sources. The separate native contention/admission change is outside this PR. No other actionable defects found in the inspected scope.
Validation limits: source analysis only, using pinned blobs (no dirty checkout inputs). No PR code, tests, builds, installs, app launches, or live workflows were executed; no CI snapshot was taken. The author's reported test results were not independently reproduced. Desktop Goose/OpenAI creation, native integration, packaged/cross-platform behavior and human acceptance remain unverified.
| {!checking && notice?.status === agent.status && !agent.error && ( | ||
| <p role="alert">{notice.text}</p> |
There was a problem hiding this comment.
[P2] Retire the failure notice when its status is superseded
This equality check only hides the notice; it never clears notice. After a card Start rejection leaves a notice for stopped, the user can open Edit → Runtime, successfully Start and then Stop the same agent, and close the editor. AgentEditor.act does not call this component's act, and the card remains mounted under its stable agent ID, so the old “The agent didn't start … Try again” alert reappears when status returns to stopped, despite the intervening successful start. This contradicts the new contract that a later status change supersedes the notice. Permanently retire it when an observed status transition leaves the recorded status, and extend the regression to cover stopped → running → stopped through another supported control surface (not this card's act).
The card badge is relay presence, refreshed every 60-65s, so a freshly started agent kept its stale Offline badge for up to a minute even though buzz-acp publishes Online within a second. While native status and the badge disagree, managed cards request an early presence read every five seconds for up to thirty seconds. The new refresh() keeps current evidence and still honors the broker's start gate. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Salman Mohammed <smohammed@squareup.com>
Adds an eye toggle to the Goose API key field once a key is typed. Saved keys stay write-only, and switching providers masks the new key again. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Salman Mohammed <smohammed@squareup.com>
Resolves AgentCard conflicts with #318 (npub display) by keeping both the npub encoding and the presence re-check. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Salman Mohammed <smohammed@squareup.com>
Why
A new Goose agent was left Process stopped after Create. Failures showed raw host text run into generic help, such as "Another native agent operation is in progress Could not confirm the operation…". After Start, the avatar dot stayed grey for about a minute, even though the agent was online within a second.
What
How
Error.cause, read byagentFailureReason, so the UI no longer parses message text.presence.refresh()every 5s for up to 30s. That call keeps current dots, and it still respects the broker's 5s gap between reads.Risk
Low. The changes are limited to the Agents page and the Create/Edit dialog. The shared presence owner gains one method, and its read limits are unchanged. The "Another native agent operation is in progress" error can still occur, because the native lock rejects overlapping commands. A separate host-admission change will fix that.
Testing
tests/browser/agent-control.spec.mjs: one assertion now expects the new stale-status line. No browser cases were added or removed. It passed locally in Chromium and WebKit (38/38).Generated with Claude Code