Skip to content

fix(agents): start new agents on Create and make their status clear - #332

Open
salman1993 wants to merge 5 commits into
mainfrom
codex/agent-create-start-ux
Open

salman1993 wants to merge 5 commits into
mainfrom
codex/agent-create-start-ux

Conversation

@salman1993

@salman1993 salman1993 commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Create now saves the agent, starts it, then publishes its profile. If a step fails, the dialog retries only that step and never makes a second identity.
  • Start/Stop failures on a card re-read the status and show the host's reason in one sentence.
  • The avatar dot updates within seconds after Start or Stop.
  • The Goose API key field has a show/hide (eye) button for a key you type.

How

  • The host's sanitized reason travels as Error.cause, read by agentFailureReason, so the UI no longer parses message text.
  • The dot is relay presence, which was re-read only every 60–65s. While a card's process status and dot disagree, the card calls the new presence.refresh() every 5s for up to 30s. That call keeps current dots, and it still respects the broker's 5s gap between reads.
  • Saved API keys stay write-only, so only a typed key can be shown. Switching providers hides the key again.

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

  • Human-tested in the app: Create starts a Goose agent. Its dot turns green within seconds, and so does g1's after Stop then Start. The API key show/hide works.
  • 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

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>
@salman1993
salman1993 marked this pull request as ready for review September 28, 2026 02:55
@salman1993
salman1993 requested review from a team, comp615 and wesbillman as code owners September 28, 2026 02:55
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 28, 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-09-28T02:59:58.229987Z 8c85ad7 Draft marked ready
ℹ️ 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.

@salman1993 salman1993 changed the title Start new agents from Create and explain failed Start/Stop fix(agents): start new agents from Create and explain failed Start/Stop Sep 28, 2026

@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: 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".

Comment on lines +130 to +133
if (!control.publishProfile)
throw new Error(
"Profile setup is unavailable. Rebuild the desktop app.",
);

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 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 wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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 COMMENT review, 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.

Comment on lines +91 to +92
{!checking && notice?.status === agent.status && !agent.error && (
<p role="alert">{notice.text}</p>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[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).

salman1993 and others added 3 commits September 28, 2026 10:52
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>
@salman1993 salman1993 changed the title fix(agents): start new agents from Create and explain failed Start/Stop fix(agents): start new agents on Create and make their status clear Sep 28, 2026
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