Skip to content

fix(templates): install from catalog Add and open chat - #193117

Closed
Patrick-Erichsen wants to merge 1 commit into
mainfrom
fix/templates-catalog-direct-add-20261104
Closed

Patrick-Erichsen wants to merge 1 commit into
mainfrom
fix/templates-catalog-direct-add-20261104

Conversation

@Patrick-Erichsen

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: clicking Add on a Template catalog card opens its details instead of adding it.

User Impact

Users can Add a Template directly from the catalog, see an in-place Adding… indicator, and enter the new agent chat automatically when installation is confirmed. Clicking the card still opens its details. Templates needing trust or capability consent still show the existing explicit review.

Why This Change Was Made

Reuse the existing installation and chat-handoff owner for catalog Add rather than routing through details first. Installation can download dependencies, write the workspace, and activate agent configuration, so chat waits for a completed Add response and a confirmed roster entry. External setup requirements such as OAuth do not prevent opening the installed agent chat. No Gateway protocol, installation policy, or persistence changes.

Evidence

  • Regression fails on the base: clicking catalog Add sends zero templates.add.apply requests.
  • 45 focused tests pass, covering direct Add, pending state, duplicate clicks, explicit risk/plugin/skill consent, errors/partial results, stale selection, existing detail Add, and routing.
  • All 9 tests in the touched production-bundle browser suite pass. The new scenario asserts no details request or early chat send, pending through installation and roster confirmation, then exactly one Add and automatic chat navigation even with OAuth setup pending.
  • Production UI, UI-pages tests, and UI-E2E tests typecheck; targeted lint, formatting, controller guard, test-line ratchet, and diff checks pass. The scoped 202-line test allocation covers the new boundary regressions without raising the shared baseline.
  • Fresh independent read-only review of the complete six-file patch found no P1/P2 blockers. Hosted ClawSweeper review is pending publication.
  • Before/after screenshots below show the former details detour, the catalog pending state, and automatic chat entry. The chat image is cropped from the same captured frame to omit unrelated composer metadata.

Proof uses synthetic Gateway responses in the real production-bundle UI; actual download duration, live provider execution, and production installation are not claimed. No merge or deployment performed.

Before: Add opens the details page

After: Add installs directly with catalog pending feedback

After: Installed agent chat opens automatically

@clawsweeper

clawsweeper Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 5, 2026
@clawsweeper

clawsweeper Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

The PR makes catalog Add install a template directly and open the confirmed new agent’s chat.

Example: Click Add on Workflow Operator 1.2.0.

  • Before: The catalog opens the template’s details.
  • After: The card shows Adding… and opens the new agent’s chat after installation and roster confirmation.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful reuse of an established owner, supported by synthetic browser evidence, with one concrete reconnect defect and an unresolved performance check.
Proof confidence 🦐 gold shrimp (3/6) Under the supplied maintainer-authorship exemption, ordinary contributor proof is not an enforced gate; inspected screenshots and production-bundle browser coverage demonstrate UI transitions using synthetic Gateway responses, without establishing real installation.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Clicking the catalog’s Add button opens details instead of adding the template.
Reason: The direction is approved by the supplied maintainer-authorship facts and matches the existing Add-to-chat contract without adding configuration or installation policy.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep this PR open: direct catalog Add is useful and still missing on main, but the new consent-review path needs reconnect recovery.

Priority: P2
Reviewed head: 7ebd88edda141f57e6dc32a76ebe65dae5ea4278

Before merge

  • Restore review details after a catalog-origin reconnect (P2) - Click catalog Add for a release requiring consent, then reconnect the same Gateway client while the detail request started by showReview() is pending. invalidateRequests() resolves that request with null and clears consent, but leaves selected and reviewing set. On reconnect, ensureInitialData calls loadCatalog(), which now returns here because catalog mode has no initialPackageName. No replacement detail request runs, so the retained detail screen has empty contents, a disabled Add button, and no retry error. Resume the selected review’s detail read on reconnect, or return it to a usable catalog state, and cover the interrupted read.

Findings

  • [P2] Restore review details after a catalog-origin reconnect — ui/src/pages/agents-home/templates-catalog-dialog.tsx:509-512

Tests

  • Missing end-to-end proof: The supplied scenarios do not exercise a same-client reconnect while catalog-origin consent details are pending.
Agent review details

How this fits together

The Control UI catalog passes a selected package to the existing Add owner, which requests Gateway installation, presents exceptional consent, and hands the confirmed agent to chat navigation.

flowchart LR
  Catalog[Template catalog] --> Owner[Existing Add owner]
  Owner --> Gateway[Gateway installation]
  Gateway --> Review[Exceptional consent review]
  Review --> Owner
  Gateway --> Roster[Confirmed agent roster]
  Roster --> Chat[New agent chat]
Loading

Technical review

Best possible solution:

Keep the shared Add owner and make its catalog-origin consent review recover automatically after reconnect.

Do we have a high-confidence way to reproduce the issue?

Current-main source directly shows Add invoking details navigation; the PR reports a failing base regression, but this review did not execute it.

Is this the best way to solve the issue?

Reusing the existing installation and chat owner is the smallest complete approach, provided catalog-origin review retains the owner’s reconnect recovery.

Full review comments:

  • [P2] Restore review details after a catalog-origin reconnect — ui/src/pages/agents-home/templates-catalog-dialog.tsx:509-512
    Click catalog Add for a release requiring consent, then reconnect the same Gateway client while the detail request started by showReview() is pending. invalidateRequests() resolves that request with null and clears consent, but leaves selected and reviewing set. On reconnect, ensureInitialData calls loadCatalog(), which now returns here because catalog mode has no initialPackageName. No replacement detail request runs, so the retained detail screen has empty contents, a disabled Add button, and no retry error. Resume the selected review’s detail read on reconnect, or return it to a usable catalog state, and cover the interrupted read.
    Confidence: 0.94

Overall correctness: patch is incorrect
Overall confidence: 0.93

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against a1f99240c836.

Provenance checked

  • Catalog Add navigation changes intended behavior with a stated reason (a4a0223: Curated discovery used the shared selection callback for catalog cards; subsequent navigation work retained dedicated package details.)
  • Installation, consent, and chat handoff keeps the original intent (feat: show Claw contents and open new agent chat after Add #171600: Add creates an ordinary agent, opens its chat after confirmation, and preserves explicit exceptional consent.)
  • Detail-only owner and Solid mutation presentation changes intended behavior with a stated reason (refactor(ui): remove retired Claws catalog dialog mode #181005: The retired modal and search branch was removed because Explore owned browsing and the only caller supplied a package; this PR explains the new catalog mutation caller while retaining Explore search ownership.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm --dir ui test src/pages/agents-home/templates-home.test.ts
  • pnpm test:ui:e2e ui/src/pages/agents-home/templates-catalog.e2e.test.ts
  • pnpm tsgo:ui
  • Verify a pending catalog consent-detail request recovers after same-client disconnect and reconnect without accepting stale consent.
  • Resolve or attribute the exact-head control-ui-performance failure without increasing its allowances.

What I checked:

  • Current main still routes Add to details: The catalog Add button invokes onSelect on fetched main; the introduced patch gives it a separate installation callback. (ui/src/pages/agents-home/templates-explore.tsx:85, a1f99240c836)
  • Reconnect skips catalog-origin review recovery: The new early return skips reconnect loading without initialPackageName. Disconnect cancellation resolves pending details with null, clears consent, and retains the review selection; the detail view then disables Add without showing a retry error. (ui/src/pages/agents-home/templates-catalog-dialog.tsx:510, 7ebd88edda14)
  • Existing product contract: The Templates documentation defines Add as creating an ordinary agent, opening its chat, and requiring explicit consent for exceptional trust warnings. Public docs: docs/cli/templates.md. (docs/cli/templates.md, 7ebd88edda14)
  • Inspected visual evidence: All three downloaded screenshots were inspected: former details navigation, catalog pending feedback, and the new chat with its initial question. The PR explicitly identifies synthetic Gateway responses. (7ebd88edda14)
  • Failed performance gate: The performance annotations report New boot gzip at 799469 bytes against a 799465-byte allowance and Chat boot growth beyond its allowance. The CI gate fails on that job; a specific source repair is not established. (scripts/check-control-ui-performance.mts:1, 7ebd88edda14)
  • Preserved server authority: The new UI entry point uses the unchanged templates.add.apply handler, whose existing authority checks require a current operator administrator and are passed into installation effects. (src/gateway/server-methods/templates-add.ts:108, 7ebd88edda14)

PR surface

Source +87, Tests +202, Other +2. Total +291 across 6 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 3 147 60 +87
Tests 2 203 1 +202
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 6 352 61 +291

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Production versus test growth Production +87 lines; tests +202 lines Growth connects catalog controls to the existing owner and covers direct-entry consent, ordering, errors, and stale navigation without adding another installation implementation.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Catalog Add currently requires a details detour, and the patch introduces a recoverable consent-review interruption on reconnect.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Determine the cause of the reported boot-bundle growth before landing.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 4, 2026, 8:54 PM ET / November 5, 2026, 01:54 UTC.

@Patrick-Erichsen

Copy link
Copy Markdown
Contributor Author

Superseded by the landed chat-first Template flow in #196395, built on #196392. Catalog Add now opens an editable pending chat while setup continues. Closing this older implementation now that its replacement is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant