oficina / equipo Public

Connections: an ended attempt's note is a dismissible notice

Paul, 2026-11-10: after an expired Claude sign-in, "The sign-in was not
finished in time." stayed under the list. It is now a quiet notice with
Dismiss (Forget, in the background), and it goes by itself once a newer
attempt starts or connects: at once in the page when an Add is chosen,
and from the server's next rendering through the stream.

Tests: TestConnectionsEndedNoteClears (failed first: a connecting
attempt left the note) and TestBrowserConnectionsEndedNote at 1280 and
390; dropping the in-page hide or the newer-attempt rule fails it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev eab9fff6022ba66996b81c5becd336214812918c parent 49fd2dd
9 files changed, +115 −6
  • docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md +1 −0
  • internal/equipo/chat_connections.go +5 −1
  • internal/equipo/connections_view.go +13 −2
  • internal/equipo/connections_view_test.go +22 −0
  • internal/equipo/copy.go +1 −0
  • internal/equipo/static/connections.js +5 −0
  • internal/equipo/static/equipo.css +8 −0
  • internal/equipo/templates/models.html +4 −3
  • internal/headless/browser_conn_add_test.go +56 −0
diff --git a/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md b/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md
index eb20931d..84204747 100644
--- a/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md
+++ b/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md
@@ -5257,6 +5257,7 @@ records remain unchanged.
| `chat.connections.answering.to_preferred` | Work moves to %s, your preference, from the next message or step once it is ready. | Connections page fixes (Paul, 2026-11-10: name the account, say what Automatic does) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| `chat.connections.answering.other` | your other %s account | Connections page fixes (Paul, 2026-11-10: name the account, say what Automatic does) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| `chat.connections.named` | %s (%s) | Connections page fixes (Paul, 2026-11-10: name the account, say what Automatic does) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
+| `chat.connections.dismiss` | Dismiss | Connections page (an ended attempt's quiet notice, Paul, 2026-11-10) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| `chat.connections.answering.connecting` | %s is connecting. Once it is ready, Review can run on another model family. | Connections slice 1 (Connections page, Paul's approved mockup) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| `chat.connections.answering.none` | Nothing can answer right now. | Connections slice 1 (Connections page, Paul's approved mockup) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| `chat.connections.answering.no_reset` | %s reported no reset time, so Equipo checks again in 15 minutes | Connections slice 1 (Connections page, Paul's approved mockup) | Runtime; COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
diff --git a/internal/equipo/chat_connections.go b/internal/equipo/chat_connections.go
index fb1bd34b..9dde2b50 100644
--- a/internal/equipo/chat_connections.go
+++ b/internal/equipo/chat_connections.go
@@ -305,7 +305,11 @@ func (a *application) connectionsCheck(w http.ResponseWriter, r *http.Request) {
// connectionsForget removes a signed-out connection, or an ended
// attempt, from the list.
func (a *application) connectionsForget(w http.ResponseWriter, r *http.Request) {
- a.chatActionTo(w, r, "/conversation/settings/connections", func(ctx context.Context, address string) error {
+ back := "/conversation/settings/connections"
+ if r.PostFormValue("from") == "add" {
+ back += "/add"
+ }
+ a.chatActionTo(w, r, back, func(ctx context.Context, address string) error {
return a.store.Chat().Forget(ctx, address, chi.URLParam(r, "id"))
})
}
diff --git a/internal/equipo/connections_view.go b/internal/equipo/connections_view.go
index 2b032ff7..ff5aa90d 100644
--- a/internal/equipo/connections_view.go
+++ b/internal/equipo/connections_view.go
@@ -104,8 +104,9 @@ func connectionsPage(snap wire.Snapshot, today map[string]int64, prefer wire.Pre
v.Attempts = append(v.Attempts, line)
v.Connecting = true
case c.State == wire.ConnError && c.LocalID == "":
- // An attempt that ended says why once, then the page moves on.
- if time.Since(c.UpdatedAt) < 10*time.Minute {
+ // An attempt that ended says why once, then the page moves on:
+ // after ten minutes, or once a newer attempt started.
+ if now.Sub(c.UpdatedAt) < 10*time.Minute && !newerThan(snap.Connections, c) {
note := copyText("chat.connections.reason." + c.Reason)
if c.Kind == wire.KindToken && c.Reason == "provider_refused" {
note = copyText("chat.connections.token_rejected")
@@ -184,6 +185,16 @@ func connectionsPage(snap wire.Snapshot, today map[string]int64, prefer wire.Pre
return v
}
+// newerThan: an attempt was started after c ended.
+func newerThan(conns []wire.Connection, c wire.Connection) bool {
+ for _, o := range conns {
+ if o.ID != c.ID && o.CreatedAt.After(c.UpdatedAt) {
+ return true
+ }
+ }
+ return false
+}
+
// tokenFacts says when a pasted token expires (about when, for an
// estimate), asks for a new one within TokenRenewal of then, and says a
// rejected one was rejected.
diff --git a/internal/equipo/connections_view_test.go b/internal/equipo/connections_view_test.go
index c3db6776..7556a0af 100644
--- a/internal/equipo/connections_view_test.go
+++ b/internal/equipo/connections_view_test.go
@@ -129,3 +129,25 @@ func TestConnectionsSummaryNoInventedPreference(t *testing.T) {
t.Fatalf("preferred sub %q", v.Answering.Sub)
}
}
+
+// An ended attempt's note (Paul, 2026-11-10: "The sign-in was not
+// finished in time." stayed under the list) gives way to a newer
+// attempt: one connecting, or one that connected.
+func TestConnectionsEndedNoteClears(t *testing.T) {
+ snap := screenshotSnapshot()
+ ended := wire.Connection{ID: "c-ended", Provider: wire.ProviderClaude, State: wire.ConnError, Reason: "timed_out", CreatedAt: screenshotNow.Add(-20 * time.Minute), UpdatedAt: screenshotNow.Add(-5 * time.Minute)}
+ snap.Connections = append(snap.Connections, ended)
+ v := connectionsPage(snap, nil, wire.Preferences{}, "", screenshotNow)
+ if len(v.Ended) != 1 || v.Ended[0].Note != "The sign-in was not finished in time." {
+ t.Fatalf("ended %+v", v.Ended)
+ }
+ for _, state := range []string{wire.ConnConnecting, wire.ConnHealthy} {
+ later := append([]wire.Connection{}, snap.Connections...)
+ later = append(later, wire.Connection{ID: "c-new", LocalID: map[string]string{wire.ConnHealthy: "claude-2"}[state], Provider: wire.ProviderClaude, State: state, CreatedAt: screenshotNow.Add(-time.Minute), UpdatedAt: screenshotNow})
+ s := snap
+ s.Connections = later
+ if v := connectionsPage(s, nil, wire.Preferences{}, "", screenshotNow); len(v.Ended) != 0 {
+ t.Fatalf("a %s attempt after it leaves the note: %+v", state, v.Ended)
+ }
+ }
+}
diff --git a/internal/equipo/copy.go b/internal/equipo/copy.go
index 4d347ccf..4c73bc3b 100644
--- a/internal/equipo/copy.go
+++ b/internal/equipo/copy.go
@@ -744,6 +744,7 @@ var pageCopy = map[string]string{
"chat.connections.answering.to_preferred": "Work moves to %s, your preference, from the next message or step once it is ready.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
"chat.connections.answering.other": "your other %s account", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
"chat.connections.named": "%s (%s)", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
+ "chat.connections.dismiss": "Dismiss", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
"chat.connections.answering.connecting": "%s is connecting. Once it is ready, Review can run on another model family.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
"chat.connections.answering.none": "Nothing can answer right now.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
"chat.connections.answering.no_reset": "%s reported no reset time, so Equipo checks again in 15 minutes", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
diff --git a/internal/equipo/static/connections.js b/internal/equipo/static/connections.js
index b178d8ae..689e5b2b 100644
--- a/internal/equipo/static/connections.js
+++ b/internal/equipo/static/connections.js
@@ -230,7 +230,12 @@
if (!adding && form.matches("[data-add-form]")) return;
event.preventDefault();
if (form.matches("[data-token-form]")) { sealToken(form); return; }
+ // An ended attempt's note goes once dismissed, or once a new
+ // attempt starts.
+ var note = form.closest("[data-connection-note]");
+ if (note) note.hidden = true;
if (form.matches("[data-add-form]")) {
+ root.querySelectorAll("[data-connection-note]").forEach(function (n) { n.hidden = true; });
var provider = form.querySelector('[name="provider"]').value;
var area = root.querySelector("[data-attempts]");
if (area && !area.querySelector('[data-connecting][data-provider="' + provider + '"]')) {
diff --git a/internal/equipo/static/equipo.css b/internal/equipo/static/equipo.css
index 4f60c74b..a07d94d3 100644
--- a/internal/equipo/static/equipo.css
+++ b/internal/equipo/static/equipo.css
@@ -859,6 +859,14 @@ a[equipo-source]:hover { color: var(--rst-text); text-decoration: underline; tex
[equipo-conn-empty] [equipo-conn-add-area] { inline-size: 100%; display: grid; justify-items: center; }
[equipo-conn-empty] [equipo-conn-chooser], [equipo-conn-empty] [equipo-conn-card] { text-align: start; inline-size: 100%; }
[equipo-inline-form] { display: inline; margin: 0; }
+/* An ended attempt's quiet notice (Paul, 2026-11-10): dismissible, and
+ gone once a newer attempt starts. */
+[equipo-conn-note] { display: flex; align-items: center; justify-content: space-between; gap: var(--rst-sp-2); max-inline-size: 34rem; margin: var(--rst-sp-3) 0 0; padding: .3rem .3rem .3rem .75rem; border: 1px solid var(--rst-line); border-radius: var(--rst-radius); background: var(--rst-surface-2); color: var(--rst-text-muted); font-size: var(--rst-fs-xs); }
+[equipo-conn-note][hidden] { display: none; }
+[equipo-conn-dismiss] { display: inline-grid; place-items: center; flex: none; inline-size: 2rem; block-size: 2rem; padding: 0; border: 0; border-radius: var(--rst-radius-sm, 4px); background: none; color: var(--rst-text-faint, var(--rst-text-muted)); cursor: pointer; }
+[equipo-conn-dismiss]:hover { color: var(--rst-text); background: var(--rst-tint-hover, var(--rst-surface)); }
+[equipo-conn-dismiss] .icon { inline-size: 1rem; block-size: 1rem; margin: 0; }
+[equipo-conn-empty] [equipo-conn-note] { inline-size: 100%; text-align: start; }
[data-copy][data-done] { color: var(--rst-tone-positive-fg); }
/* Copy link beside an Open button (Paul, 2026-11-09: to open the link in
another browser). */
diff --git a/internal/equipo/templates/models.html b/internal/equipo/templates/models.html
index daea6f4c..33384eec 100644
--- a/internal/equipo/templates/models.html
+++ b/internal/equipo/templates/models.html
@@ -55,6 +55,7 @@
<button type="button" equipo-conn-opt disabled>{{template "conn-mark" "tensorx"}}<span><span equipo-conn-opt-name>{{copy "chat.connections.tensorx"}}</span><span equipo-conn-opt-desc>{{copy "chat.connections.tensorx_desc"}}</span></span><span equipo-conn-soon>{{copy "chat.connections.soon"}}</span></button>
</div>{{end}}
{{define "conn-add-link"}}<a rst-btn{{if .}}="primary"{{end}} href="/conversation/settings/connections/add" equipo-conn-add data-add-link>{{icon "plug"}}{{copy "chat.connections.add"}}</a>{{end}}
+{{define "conn-note"}}<div equipo-conn-note data-connection="{{.Row.ID}}" data-connection-note role="status"><span>{{.Row.Note}}</span><form method="post" action="/conversation/connections/{{.Row.ID}}/forget" equipo-inline-form>{{if .Add}}<input type="hidden" name="from" value="add">{{end}}<button type="submit" equipo-conn-dismiss aria-label="{{copy "chat.connections.dismiss"}}" title="{{copy "chat.connections.dismiss"}}" data-dismiss>{{icon "x"}}</button></form></div>{{end}}
{{define "conn-row"}}<article equipo-conn-row data-connection="{{.ID}}" data-provider="{{.Provider}}" data-state="{{.State}}"{{if .Needs}} data-needs{{end}}{{if .New}} data-new{{end}}>
{{template "conn-mark" .Provider}}
<div equipo-conn-body>
@@ -78,7 +79,7 @@
{{else}}<header equipo-conn-page-head><h1>{{copy "chat.connections.title"}}</h1>{{if .Models.Rows}}<p>{{copy "chat.connections.lede"}}</p>{{end}}</header>{{end}}
{{if .Models.Offline}}<p equipo-offline role="status">{{copy "chat.connections.offline"}}</p>{{end}}
<div data-connections-live>
-{{if .Models.Adding}}{{range .Models.Ended}}<p equipo-conn-small data-connection="{{.ID}}" data-connection-note>{{.Note}}</p>{{end}}
+{{if .Models.Adding}}{{range .Models.Ended}}{{template "conn-note" (dict "Row" . "Add" $.Models.Adding)}}{{end}}
<div equipo-conn-add-area data-attempts>{{range .Models.Attempts}}{{template "conn-attempt" .}}{{else}}{{template "conn-chooser"}}{{end}}</div>
<div hidden>{{range .Models.Rows}}<i data-held-connection="{{.ID}}" data-state="{{.State}}" data-account="{{.Label}}"></i>{{end}}</div>
{{else if .Models.Rows}}{{with .Models.Answering}}<section equipo-conn-answering{{with .Tone}} data-tone="{{.}}"{{end}} aria-label="{{copy "chat.connections.title"}}" data-answering>{{if .Tone}}<span equipo-conn-lead-icon aria-hidden="true">{{icon "alert-triangle"}}</span>{{else}}{{template "conn-star"}}{{end}}<p equipo-conn-lead>{{.LeadStart}}<b>{{.LeadName}}</b>{{.LeadEnd}}</p><p equipo-conn-sub>{{.Sub}}{{if .SeeConversation}} <a href="/conversation">{{copy "chat.connections.answering.see"}}</a>{{end}}</p>
@@ -86,13 +87,13 @@
</section>{{end}}
<section equipo-conn-group><h2>{{copy "chat.connections.group"}} <span equipo-conn-n>{{len .Models.Rows}}</span><span equipo-conn-hint>{{copy "chat.connections.usage_resets"}}</span></h2>
<div equipo-conn-list data-connection-list aria-live="polite">{{range .Models.Rows}}{{template "conn-row" .}}{{end}}</div>
-{{range .Models.Ended}}<p equipo-conn-small data-connection="{{.ID}}" data-connection-note>{{.Note}}</p>{{end}}
+{{range .Models.Ended}}{{template "conn-note" (dict "Row" . "Add" $.Models.Adding)}}{{end}}
<div equipo-conn-add-foot>{{template "conn-add-link" false}}<span>{{copy "chat.connections.add_hint"}}</span></div>
</section>
{{else}}<section equipo-conn-empty data-empty-state="chat.connections.empty"><p equipo-conn-pair>{{template "conn-mark" "claude"}}{{template "conn-mark" "codex"}}</p>
<h2>{{copy "chat.connections.empty_title"}}</h2>
<p>{{copy "chat.connections.empty_body"}}</p>
-{{range .Models.Ended}}<p equipo-conn-small data-connection="{{.ID}}" data-connection-note>{{.Note}}</p>{{end}}
+{{range .Models.Ended}}{{template "conn-note" (dict "Row" . "Add" $.Models.Adding)}}{{end}}
{{template "conn-add-link" true}}
<p equipo-conn-fine>{{copy "chat.connections.empty_fine"}}</p>
<div hidden data-connection-list></div>
diff --git a/internal/headless/browser_conn_add_test.go b/internal/headless/browser_conn_add_test.go
index 87919247..d31c5b35 100644
--- a/internal/headless/browser_conn_add_test.go
+++ b/internal/headless/browser_conn_add_test.go
@@ -70,3 +70,59 @@ func TestBrowserConnectionsAddPage(t *testing.T) {
})
}
}
+
+// Paul, 2026-11-10: after an expired Claude sign-in, "The sign-in was
+// not finished in time." stayed under the list. It is a quiet notice
+// with Dismiss, and it goes by itself, live, once a newer attempt starts
+// or connects.
+func TestBrowserConnectionsEndedNote(t *testing.T) {
+ const note = `[...document.querySelectorAll('[data-connection-note]')].filter(n=>n.checkVisibility() && n.textContent==='The sign-in was not finished in time.')`
+ for _, width := range []int64{1280, 390} {
+ t.Run(strconv.FormatInt(width, 10), func(t *testing.T) {
+ inst := thintest.StartInstance(t)
+ runner := dialFake(t, inst)
+ client := thintest.NewClient(inst.URL, inst.DeviceToken(t))
+ c := inst.Cookie()
+ p := openPage(t, inst.URL, c.Name, c.Value, width, 900, width > 600)
+ t.Cleanup(p.stop)
+ ended := func(provider string) {
+ t.Helper()
+ a, err := client.Connect(t.Context(), wire.Connect{Provider: provider})
+ if err != nil {
+ t.Fatal(err)
+ }
+ runner.expect(t, wire.FrameConnect)
+ runner.send(t, wire.FrameConnection, wire.ConnectionReport{Connection: a.ID, Person: thintest.Owner, Provider: provider, State: wire.ConnError, Reason: "timed_out"})
+ }
+ ended("claude")
+ p.run(chromedp.Navigate(inst.URL+"/conversation/settings/connections"), browsertest.Wait(note+`.length===1`))
+ p.check(`(()=>{window.__equipoStayed=true;const b=document.querySelector('[data-connection-note] [data-dismiss]');return b.checkVisibility() && b.getAttribute('aria-label')==='Dismiss'})()`, "the notice has no Dismiss")
+ connShotOn(t, p, addDay, "ended-note", width)
+ // Dismissed: gone at once, and for good.
+ p.check(`(()=>{document.querySelector('[data-connection-note] [data-dismiss]').click();return `+note+`.length===0})()`, "Dismiss did not hide the notice")
+ p.run(waitLong(`!document.querySelector('[data-connection-note]')`))
+ p.check(stayed, "the page reloaded or navigated on Dismiss")
+
+ // A newer attempt that connects clears it, live.
+ ended("claude")
+ p.run(waitLong(note + `.length===1`))
+ a, err := client.Connect(t.Context(), wire.Connect{Provider: "codex"})
+ if err != nil {
+ t.Fatal(err)
+ }
+ runner.expect(t, wire.FrameConnect)
+ runner.send(t, wire.FrameConnection, wire.ConnectionReport{Connection: a.ID, Person: thintest.Owner, LocalID: "codex-1", Provider: "codex", State: wire.ConnHealthy, Label: second, Plan: "pro"})
+ p.run(waitLong(`!!document.querySelector('[equipo-conn-row][data-provider="codex"]') && ` + note + `.length===0`))
+ p.check(stayed, "the page reloaded or navigated")
+
+ // On the Add page, choosing a provider starts a newer attempt:
+ // the notice goes at once and stays gone.
+ ended("claude")
+ p.run(chromedp.Navigate(inst.URL+"/conversation/settings/connections/add"), browsertest.Wait(note+`.length===1`))
+ p.check(`(()=>{window.__equipoStayed=true;document.querySelector('[data-add="claude"]').click();return `+note+`.length===0})()`, "a new attempt left the notice")
+ runner.expect(t, wire.FrameConnect)
+ p.run(waitLong(`!!document.querySelector('[data-token-form]') && ` + note + `.length===0`))
+ p.check(stayed, "the page reloaded or navigated")
+ })
+ }
+}