oficina / equipo Public

chat: say why a reply failed, and offer Try again

The failed-reply note now names the reason the runner reported: ran out
of time, runner stopped, the model or account failed, signed out, at its
limit, a safety check, a file that did not arrive, or an old runner,
with the account where Equipo knows it. Copy approved by Paul
(2026-11-22, unchanged).

Try again (web and device API) retries the latest failed turn once,
idempotently, by moving the failed exchange (messages, cards, tasks,
tool calls, steps, hand-off) onto a new turn that runs as its next
attempt. Spent creation permission stays spent; moved tasks, steps and
cards publish at a new revision. A queued retry dispatches on the old
binary after a rollback. Sign in again replaces it for a signed-out
account; at a limit it waits for the reset.

Astra: READY AFTER FIXES, NOT APPROVED (two move-design findings),
APPROVED on round 3.

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

Squashed from failed-reply-reasons into main.
Paul Campbell pushed by claude agent, operated by paul@keymail.dev 60c5885443bd2f66c0d3ac45ae31eb002efafdbd parent 5eef34a
24 files changed, +1,360 −27
  • .rastrillo/budgets.txt +4 −4
  • docs/api/equipo-v1.openapi.json +62 −0
  • docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md +13 −0
  • internal/equipo/app.go +1 −0
  • internal/equipo/chat/http.go +13 −0
  • internal/equipo/chat/models.go +3 −0
  • internal/equipo/chat/retry.go +219 −0
  • internal/equipo/chat_failed.go +132 −0
  • internal/equipo/chat_failed_test.go +79 −0
  • internal/equipo/chat_page.go +11 −16
  • internal/equipo/copy.go +13 −0
  • internal/equipo/migrations/0099_turn_retry.sql +3 −0
  • internal/equipo/migrations/schema.sql +2 −0
  • internal/equipo/static/chat-stream.js +7 −0
  • internal/equipo/static/equipo.css +4 −0
  • internal/equipo/templates/chat.html +1 −1
  • internal/plan3test/plan3_release_test.go +3 −1
  • internal/thintest/batching_contract_test.go +4 −3
  • internal/thintest/client.go +5 −0
  • internal/thintest/instant_browser_test.go +3 −2
  • internal/thintest/retry_authority_contract_test.go +335 −0
  • internal/thintest/retry_browser_test.go +74 −0
  • internal/thintest/retry_contract_test.go +368 −0
  • internal/wire/wireschema/wireschema.go +1 −0

CI passed — run details

CI log
=== prepare ===
ci-box: machine: aarch64, 32 CPUs, 62 GiB memory, kernel 7.0.0-1017-aws
ci-box: python 3.12.3; Docker version 29.1.3, build 29.1.3-0ubuntu3~24.04.2
ci-box: user namespaces allowed: 233151
ci-box: cgroup: cgroup2fs
ci-box: disk /home/ci/work/repos/oficina__equipo/wt/main: Type  Size Avail | ext4   96G   85G
ci-box: disk /home/ci/.cache/equipo-ci-box: Type  Size Avail | ext4   96G   85G
ci-box: bwrap: fetched and verified in 0.3s
ci-box: claude: fetched and verified in 1.3s
ci-box: codex: fetched and verified in 3.6s
ci-box: codex-code-mode-host: fetched and verified in 1.4s
ci-box: libwrap: fetched and verified in 0.3s
ci-box: socat: fetched and verified in 0.4s
npm warn deprecated node-domexception@1.0.0: Use your platform's native DOMException instead
ci-box: image pulled in 9.9s
ci-box: pi: installed and verified in 7.2s
ci-box: opencode: installed and verified in 2.3s
ci-box: chromium 156.0.8078.79-1~deb13u1: 76 packages fetched, verified and unpacked in 9.5s
ci-box: clone deepened in 3.7s
ci-box: file times set from content: 2828 files, 185 directories
ci-box: ready in 17.2s
=== copy ===
EQUIPO_RELEASE_COPY_CHECK=1 CGO_ENABLED=0 go test ./internal/equipotest -run '^TestReleaseCopyReviewed$' -count=1
ok  	amadan.net/oficina/equipo/internal/equipotest	0.251s
=== compile ===
go build ./...
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py compile
+ go build -tags testbuild ./...
  3.8s
+ go list -export -test -tags testbuild -f  ./...
  3.7s
+ go list -export -test -tags browser,testbuild -f  ./internal/equipo ./internal/headless ./internal/idtest ./internal/plan3test ./internal/thintest
  3.1s
go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 -version
staticcheck 2026.1 (v0.7.0)
go run golang.org/x/vuln/cmd/govulncheck@v1.8.0 -version
Go: go1.26.11
Scanner: govulncheck@v1.8.0
DB: https://vuln.go.dev
DB updated: 2026-11-11 02:51:11 +0000 UTC

go run github.com/zricethezav/gitleaks/v8@v8.30.1 version
version is set by build process
=== check ===
--- shard 0 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-work: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestHeadless$/^4c_rebase$|^TestHeadless$/^4b_ask$|^TestHeadless$/^4c_checks_card$|^TestHeadless$/^4_step_crash$' ./internal/headless
rastrillo: budget test: go test failed
--- FAIL amadan.net/oficina/equipo/internal/headless TestHeadless
=== RUN   TestHeadless
--- FAIL: TestHeadless (78.70s)

--- FAIL amadan.net/oficina/equipo/internal/headless TestHeadless/4c_rebase
=== RUN   TestHeadless/4c_rebase
time=2026-11-22T12:38:41.202Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-22T12:38:41.202Z level=INFO msg="startup phase done" phase=state_lock took=63µs
time=2026-11-22T12:38:41.202Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-22T12:38:41.202Z level=INFO msg="startup phase done" phase=claim_roots took=93µs
time=2026-11-22T12:38:41.202Z level=INFO msg="startup phase" phase=sweep
time=2026-11-22T12:38:41.229Z level=INFO msg="startup phase done" phase=sweep took=27.13ms
time=2026-11-22T12:38:41.229Z level=INFO msg="startup phase" phase=credentials
time=2026-11-22T12:38:41.229Z level=INFO msg="startup phase done" phase=credentials took=212µs
time=2026-11-22T12:38:41.230Z level=INFO msg="startup phase" phase=open_state
time=2026-11-22T12:38:41.272Z level=INFO msg="startup phase done" phase=open_state took=42.068ms
time=2026-11-22T12:38:41.272Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-22T12:38:41.273Z level=INFO msg=connecting host=127.0.0.1:33827 protocol=28
time=2026-11-22T12:38:41.274Z level=INFO msg=connected host=127.0.0.1:33827 took=907µs
time=2026-11-22T12:38:41.274Z level=INFO msg="capabilities gathering"
time=2026-11-22T12:38:41.275Z level=INFO msg="capabilities gathered" took=481µs tags=linux,claude,go
time=2026-11-22T12:38:41.275Z level=INFO msg="hello sent" protocol=28
time=2026-11-22T12:38:41.282Z level=INFO msg=welcome protocol=28 role=primary generation=1
time=2026-11-22T12:38:42.308Z level=INFO msg="connection checked" connection=claude-1 state=healthy
time=2026-11-22T12:38:47.273Z level=INFO msg="kept sessions" kept=1 bytes=2824 expired=0
time=2026-11-22T12:38:53.322Z level=INFO msg="kept sessions" kept=2 bytes=5030 expired=0
    merge_test.go:245: steps [engineering:done checks:passed review:approve merge:merge_conflict engineering:queued], want [engineering:done checks:passed review:approve merge:merge_conflict engineering:done checks:passed review:approve merge:done] (in_progress )
time=2026-11-22T12:38:53.454Z level=WARN msg="step base" err=*fmt.wrapError
--- FAIL: TestHeadless/4c_rebase (12.66s)

--- FAIL amadan.net/oficina/equipo/internal/headless (package output)
FAIL
rastrillo-budget/v1 ran 1m18.697s
FAIL	amadan.net/oficina/equipo/internal/headless	79.033s


receipt: test step 1m20.288s against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 0 cached, 0 without tests, 1 failed
receipt: slow package 1m18.697s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m18.7s amadan.net/oficina/equipo/internal/headless TestHeadless
exit status 1
+ go test -tags testbuild -timeout 15m -run '^TestHeadless$/^4c_rebase$|^TestHeadless$/^4b_ask$|^TestHeadless$/^4c_checks_card$|^TestHeadless$/^4_step_crash$' -v -run '^TestHeadless$/^4c_rebase$' -count=1 ./internal/headless   (retry, once)
##############################################################################
FLAKE ./internal/headless:TestHeadless/4c_rebase headless-work 60c5885443bd2f66c0d3ac45ae31eb002efafdbd 12.66s 52.95
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
machine: 32 CPUs, load 46.46, cpu waiting 33.10%, memory waiting 0.00%, io waiting 0.36%
--- shard 1 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-review: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestHeadless$/^4_review$|^TestHeadless$/^2b_access$|^TestHeadless$/^runner_crash$|^TestHeadless$/^2b_first_message$|^TestHeadless$/^4_checks_honest$|^TestHeadless$/^7_stream_resume$|^TestHeadless$/^2b_notebook$|^TestHeadless$/^2b_move_in$|^TestHeadless$/^2b_desk_failure$|^TestHeadless$/^cancel$' ./internal/headless

receipt: test step 1m32.71s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m30.866s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m30.87s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 51.69, cpu waiting 36.55%, memory waiting 0.00%, io waiting 0.42%
--- shard 2 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-connections: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestHeadlessConnections$|^TestHeadlessTokenPasteEndToEnd$|^TestHeadlessTokenConnection$' ./internal/headless

receipt: test step 1m34.036s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m32.138s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m20.53s amadan.net/oficina/equipo/internal/headless TestHeadlessConnections
receipt: slow test 6.27s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenPasteEndToEnd
receipt: slow test 5.34s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenConnection
machine: 32 CPUs, load 51.69, cpu waiting 36.17%, memory waiting 0.00%, io waiting 0.41%
--- shard 3 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-mac: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestMacWorker$|^TestHeadlessAttachments$|^TestHeadlessPrewarm$|^TestHeadless$/^1_first_token$|^TestHeadless$/^6_quick_messages$|^TestHeadless$/^8_instance_restart$|^TestHeadless$/^3_runner_offline$' ./internal/headless

receipt: test step 1m28.715s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m27.025s amadan.net/oficina/equipo/internal/headless
receipt: slow test 44.29s amadan.net/oficina/equipo/internal/headless TestMacWorker
receipt: slow test 22.22s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 10.85s amadan.net/oficina/equipo/internal/headless TestHeadlessAttachments
receipt: slow test 9.67s amadan.net/oficina/equipo/internal/headless TestHeadlessPrewarm
machine: 32 CPUs, load 53.76, cpu waiting 36.63%, memory waiting 0.00%, io waiting 0.44%
--- shard 4 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-guards: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestHeadlessCopyRotation$|^TestHeadlessPolicyGuards$|^TestHeadlessRunnerKillLeavesNoCopies$|^TestHeadlessNewHouseRuleStartsFresh$|^TestHeadless$/^3_engineering$|^TestHeadless$/^3_step_cancel$|^TestHeadless$/^3_step_contained$|^TestHeadless$/^3_empty_repo$|^TestHeadless$/^3_empty_engineering$|^TestHeadless$/^3_empty_merge$|^TestHeadless$/^3_empty_merge_rebuilt$|^TestHeadless$/^3_empty_fix_round$' ./internal/headless

receipt: test step 1m46.328s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m44.784s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m6.69s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 12.34s amadan.net/oficina/equipo/internal/headless TestHeadlessRunnerKillLeavesNoCopies
receipt: slow test 10.51s amadan.net/oficina/equipo/internal/headless TestHeadlessCopyRotation
receipt: slow test 9.15s amadan.net/oficina/equipo/internal/headless TestHeadlessPolicyGuards
receipt: slow test 6.09s amadan.net/oficina/equipo/internal/headless TestHeadlessNewHouseRuleStartsFresh
machine: 32 CPUs, load 43.54, cpu waiting 30.11%, memory waiting 0.00%, io waiting 0.32%
--- shard 5 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-rest: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -skip '^TestHeadless$/^4c_rebase$|^TestHeadless$/^4b_ask$|^TestHeadless$/^4c_checks_card$|^TestHeadless$/^4_step_crash$|^TestHeadless$/^4_review$|^TestHeadless$/^2b_access$|^TestHeadless$/^runner_crash$|^TestHeadless$/^2b_first_message$|^TestHeadless$/^4_checks_honest$|^TestHeadless$/^7_stream_resume$|^TestHeadless$/^2b_notebook$|^TestHeadless$/^2b_move_in$|^TestHeadless$/^2b_desk_failure$|^TestHeadless$/^cancel$|^TestHeadlessConnections$|^TestHeadlessTokenPasteEndToEnd$|^TestHeadlessTokenConnection$|^TestMacWorker$|^TestHeadlessAttachments$|^TestHeadlessPrewarm$|^TestHeadless$/^1_first_token$|^TestHeadless$/^6_quick_messages$|^TestHeadless$/^8_instance_restart$|^TestHeadless$/^3_runner_offline$|^TestHeadlessCopyRotation$|^TestHeadlessPolicyGuards$|^TestHeadlessRunnerKillLeavesNoCopies$|^TestHeadlessNewHouseRuleStartsFresh$|^TestHeadless$/^3_engineering$|^TestHeadless$/^3_step_cancel$|^TestHeadless$/^3_step_contained$|^TestHeadless$/^3_empty_repo$|^TestHeadless$/^3_empty_engineering$|^TestHeadless$/^3_empty_merge$|^TestHeadless$/^3_empty_merge_rebuilt$|^TestHeadless$/^3_empty_fix_round$' ./internal/headless

receipt: test step 3m18.302s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 3m16.605s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m53.81s amadan.net/oficina/equipo/internal/headless TestHeadlessAssistant
receipt: slow test 24.26s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 11.58s amadan.net/oficina/equipo/internal/headless TestHeadlessResearchHandoff
receipt: slow test 8.16s amadan.net/oficina/equipo/internal/headless TestHeadlessClaudeSignIn
receipt: slow test 7.39s amadan.net/oficina/equipo/internal/headless TestHeadlessTurnBatching
machine: 32 CPUs, load 12.85, cpu waiting 6.59%, memory waiting 0.00%, io waiting 0.06%
--- shard 6 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane thintest: ./internal/thintest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^Test([^C]|C[^o]|Co[^n]|Con[^t])|^TestContract(Assistant|Outcome|Team|Handoff|HostAllowlist|HostIsPerPerson|Look|Use[A-Z]|RemoteCall|LanesRunAtOnce|NoMergeQuestionWhenGateMerges|PreviewHeldUntilPublishAnswer|PreviewNotHeldBelow19|PublishNeedsOwnerAnswer)' ./internal/thintest

receipt: test step 2m3.469s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 2m1.624s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 7.84s amadan.net/oficina/equipo/internal/thintest TestContractTeamJobSettledStates
receipt: slow test 6.74s amadan.net/oficina/equipo/internal/thintest TestExplorePreviewsOff
receipt: slow test 4.31s amadan.net/oficina/equipo/internal/thintest TestContractTeamUpdatePersonNeeds
receipt: slow test 3.81s amadan.net/oficina/equipo/internal/thintest TestContractPreviewHeldUntilPublishAnswer
receipt: slow test 3.52s amadan.net/oficina/equipo/internal/thintest TestContractTeamNudgePersonNeeds
machine: 32 CPUs, load 36.93, cpu waiting 23.16%, memory waiting 0.00%, io waiting 0.24%
--- shard 7 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane thintest-contract: ./internal/thintest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -skip '^Test([^C]|C[^o]|Co[^n]|Con[^t])|^TestContract(Assistant|Outcome|Team|Handoff|HostAllowlist|HostIsPerPerson|Look|Use[A-Z]|RemoteCall|LanesRunAtOnce|NoMergeQuestionWhenGateMerges|PreviewHeldUntilPublishAnswer|PreviewNotHeldBelow19|PublishNeedsOwnerAnswer)' ./internal/thintest

receipt: test step 1m28.857s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m26.784s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 9.08s amadan.net/oficina/equipo/internal/thintest TestContractPreviewNotScheduled
receipt: slow test 5.03s amadan.net/oficina/equipo/internal/thintest TestContractPublishNotOffered
receipt: slow test 4.41s amadan.net/oficina/equipo/internal/thintest TestContractMacRecheckMergeAuthority
receipt: slow test 2.4s amadan.net/oficina/equipo/internal/thintest TestContractPreview
receipt: slow test 2.34s amadan.net/oficina/equipo/internal/thintest TestContractPublishNameTaken
machine: 32 CPUs, load 53.76, cpu waiting 36.63%, memory waiting 0.00%, io waiting 0.44%
--- shard 8 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane runner-thin: ./internal/runner/thin
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m ./internal/runner/thin
cache miss: amadan.net/oficina/equipo/internal/runner/thin: its inputs changed
budget note: internal/runner/thin took 4m36.693s, over the 45s its record on line 44 allows; reported only, timing fails on CI

receipt: test step 4m49.669s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 4m36.693s amadan.net/oficina/equipo/internal/runner/thin
receipt: slow test 36.97s amadan.net/oficina/equipo/internal/runner/thin TestModelsEngineeringProbesThenRunsTheStrongest
receipt: slow test 36.96s amadan.net/oficina/equipo/internal/runner/thin TestModelsProbeAnsweredByAnotherModel
receipt: slow test 36.78s amadan.net/oficina/equipo/internal/runner/thin TestModelsUnhealthyRetriedOnDemand
receipt: slow test 18.47s amadan.net/oficina/equipo/internal/runner/thin TestModelsProbeRunsInsideTheAdmission
receipt: slow test 6.97s amadan.net/oficina/equipo/internal/runner/thin TestOpenCodeStepsRealOpenCode
machine: 32 CPUs, load 3.36, cpu waiting 1.47%, memory waiting 0.00%, io waiting 0.00%
--- shard 9 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane runner-bug: ./internal/runner
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestDirectBugWorkflow$|^TestEnrolKeepsTheRole$' ./internal/runner
cache miss: amadan.net/oficina/equipo/internal/runner: its inputs changed

receipt: test step 49.624s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 48.49s amadan.net/oficina/equipo/internal/runner
receipt: slow test 28.46s amadan.net/oficina/equipo/internal/runner TestDirectBugWorkflow
receipt: slow test 20.02s amadan.net/oficina/equipo/internal/runner TestEnrolKeepsTheRole
machine: 32 CPUs, load 52.88, cpu waiting 29.07%, memory waiting 0.00%, io waiting 0.86%
--- shard 10 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane runner-plans: ./internal/runner
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestPlanWorkflowCandidateOrder$|^TestPlanWorkflowFeature$|^TestCoordinatorRecoveryCallRefusalKeepsServing$|^TestCoordinatorRefusalMatrix$' ./internal/runner
cache miss: amadan.net/oficina/equipo/internal/runner: its inputs changed

receipt: test step 57.74s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 55.7s amadan.net/oficina/equipo/internal/runner
receipt: slow test 45.66s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowCandidateOrder
receipt: slow test 41.82s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowFeature
receipt: slow test 8.39s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryCallRefusalKeepsServing
receipt: slow test 1.63s amadan.net/oficina/equipo/internal/runner TestCoordinatorRefusalMatrix
machine: 32 CPUs, load 54.31, cpu waiting 32.90%, memory waiting 0.00%, io waiting 0.75%
--- shard 11 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane runner-rest: ./internal/runner
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -skip '^TestDirectBugWorkflow$|^TestEnrolKeepsTheRole$|^TestPlanWorkflowCandidateOrder$|^TestPlanWorkflowFeature$|^TestCoordinatorRecoveryCallRefusalKeepsServing$|^TestCoordinatorRefusalMatrix$' ./internal/runner
cache miss: amadan.net/oficina/equipo/internal/runner: its inputs changed

receipt: test step 36.058s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 35.065s amadan.net/oficina/equipo/internal/runner
receipt: slow test 5.15s amadan.net/oficina/equipo/internal/runner TestDirectFaultIsolation
receipt: slow test 3.39s amadan.net/oficina/equipo/internal/runner TestClaimRefusalsBackOff
receipt: slow test 3.12s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryRefusedKeepsServing
receipt: slow test 2.83s amadan.net/oficina/equipo/internal/runner TestToolVerbUnderFakeHarness
receipt: slow test 1.61s amadan.net/oficina/equipo/internal/runner TestCoordinatorTransientRefusalKeepsServing
machine: 32 CPUs, load 35.54, cpu waiting 18.82%, memory waiting 0.00%, io waiting 1.09%
--- shard 12 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: equipotest-a started 30s late; cpu waiting 36.1%, load 24.53
test lane equipotest-a: ./internal/equipotest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^Test[A-D]|^TestQ' ./internal/equipotest

receipt: test step 1m6.399s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m4.497s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 26.61s amadan.net/oficina/equipo/internal/equipotest TestAuthorityCoreIntegration
receipt: slow test 26.49s amadan.net/oficina/equipo/internal/equipotest TestBootstrapNamesOwnersSetting
receipt: slow test 24.39s amadan.net/oficina/equipo/internal/equipotest TestAccountLabelMigration
receipt: slow test 21.93s amadan.net/oficina/equipo/internal/equipotest TestBudgetConfigurationFailuresAreAtomic
receipt: slow test 21.87s amadan.net/oficina/equipo/internal/equipotest TestAccountConcurrentDuplicate
machine: 32 CPUs, load 51.69, cpu waiting 35.64%, memory waiting 0.00%, io waiting 0.39%
--- shard 13 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: equipotest-e started 30s late; cpu waiting 36.1%, load 24.53
test lane equipotest-e: ./internal/equipotest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^Test[E-P]' ./internal/equipotest

receipt: test step 1m14.666s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m12.809s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 19.04s amadan.net/oficina/equipo/internal/equipotest TestProjectWritesRequireCurrentOwner
receipt: slow test 18.97s amadan.net/oficina/equipo/internal/equipotest TestProjectRejectsUnsafeBinding
receipt: slow test 18.96s amadan.net/oficina/equipo/internal/equipotest TestProjectsFailuresRollBack
receipt: slow test 18.9s amadan.net/oficina/equipo/internal/equipotest TestProjectsReopen
receipt: slow test 18.83s amadan.net/oficina/equipo/internal/equipotest TestProjectBindingUniqueness
machine: 32 CPUs, load 46.46, cpu waiting 31.09%, memory waiting 0.00%, io waiting 0.33%
--- shard 14 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: equipotest-r started 30s late; cpu waiting 36.1%, load 24.53
test lane equipotest-r: ./internal/equipotest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestR' ./internal/equipotest

receipt: test step 1m12.748s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m7.534s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 14.64s amadan.net/oficina/equipo/internal/equipotest TestReleaseStampContract
receipt: slow test 13.02s amadan.net/oficina/equipo/internal/equipotest TestRosterChangesAffectExistingSession
receipt: slow test 9.91s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalRollsBack
receipt: slow test 9.84s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalWhileAssigned
receipt: slow test 6.9s amadan.net/oficina/equipo/internal/equipotest TestRosterProtectsLastOwner
machine: 32 CPUs, load 46.46, cpu waiting 32.11%, memory waiting 0.00%, io waiting 0.34%
--- shard 15 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: equipotest-rest started 30s late; cpu waiting 36.1%, load 24.53
test lane equipotest-rest: ./internal/equipotest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -skip '^Test[A-D]|^TestQ|^Test[E-P]|^TestR' ./internal/equipotest

receipt: test step 1m7.288s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m5.394s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 24.73s amadan.net/oficina/equipo/internal/equipotest TestSigninNoProof
receipt: slow test 23.97s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedExistingTeam
receipt: slow test 23.93s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedRollback
receipt: slow test 22.16s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsUpgrade
receipt: slow test 21.99s amadan.net/oficina/equipo/internal/equipotest TestSpecialistSettings
machine: 32 CPUs, load 49.72, cpu waiting 35.00%, memory waiting 0.00%, io waiting 0.38%
--- shard 16 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: plan3test started 30s late; cpu waiting 36.1%, load 24.53
test lane plan3test: ./internal/plan3test
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m ./internal/plan3test

receipt: test step 52.989s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 51.065s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 3.56s amadan.net/oficina/equipo/internal/plan3test TestPlan3Upgrade
receipt: slow test 3.47s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3B
receipt: slow test 1.54s amadan.net/oficina/equipo/internal/plan3test TestConversationQuestionRace
receipt: slow test 1.45s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3A
receipt: slow test 1.25s amadan.net/oficina/equipo/internal/plan3test TestInviteMigration
machine: 32 CPUs, load 52.95, cpu waiting 36.07%, memory waiting 0.00%, io waiting 0.48%
--- shard 17 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: rest started 30s late; cpu waiting 36.1%, load 24.53
test lane rest: ./cmd/equipo ./cmd/equipo-runner ./cmd/equipo-tool-proxy ./internal/advice ./internal/attach ./internal/attach/attachtest ./internal/chatmarkdown ./internal/chatsend ./internal/chatstream ./internal/coordinator ./internal/coordinatorcontract ./internal/coordinatormail ./internal/copydesk ./internal/equipo ./internal/equipo/activity ./internal/equipo/assist ./internal/equipo/chat ./internal/equipo/conversation ./internal/equipo/conversation/chatstate ./internal/equipo/housekeeping ./internal/equipo/icons ./internal/equipo/identity ./internal/equipo/kernel ./internal/equipo/library ./internal/equipo/mergegate ./internal/equipo/notifications ./internal/equipo/oficina ./internal/equipo/oficina/oficinatest ./internal/equipo/oficinaid ./internal/equipo/ownermode ./internal/equipo/personapi ./internal/equipo/planning ./internal/equipo/push ./internal/equipo/setup ./internal/equipo/team ./internal/equipo/teamcontract ./internal/equipo/triage ./internal/fakeclaude ./internal/fakecodex ./internal/fakeopencode ./internal/fakepi ./internal/idtest ./internal/ownermodetest ./internal/release ./internal/runner/checks ./internal/runner/connect ./internal/runner/containment ./internal/runner/containment/sysunix ./internal/runner/egress ./internal/runner/forge ./internal/runner/forge/forgetest ./internal/runner/heartbeat ./internal/runner/mac ./internal/runner/mcpresource ./internal/runner/metered ./internal/runner/planflow ./internal/runner/provider ./internal/runner/provider/claude ./internal/runner/provider/codex ./internal/runner/provider/gotoolchain ./internal/runner/provider/opencode ./internal/runner/provider/pi ./internal/runner/setup ./internal/runner/transporttest ./internal/runner/webread ./internal/runner/workspace ./internal/runnerproto ./internal/schedule ./internal/sealbox ./internal/specialist ./internal/stagingtest ./internal/taskplan ./internal/testci ./internal/toolproxy ./internal/websource ./internal/wire ./internal/wire/wireschema ./internal/wire/wiretest ./tools/drive
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m ./cmd/equipo ./cmd/equipo-runner ./cmd/equipo-tool-proxy ./internal/advice ./internal/attach ./internal/attach/attachtest ./internal/chatmarkdown ./internal/chatsend ./internal/chatstream ./internal/coordinator ./internal/coordinatorcontract ./internal/coordinatormail ./internal/copydesk ./internal/equipo ./internal/equipo/activity ./internal/equipo/assist ./internal/equipo/chat ./internal/equipo/conversation ./internal/equipo/conversation/chatstate ./internal/equipo/housekeeping ./internal/equipo/icons ./internal/equipo/identity ./internal/equipo/kernel ./internal/equipo/library ./internal/equipo/mergegate ./internal/equipo/notifications ./internal/equipo/oficina ./internal/equipo/oficina/oficinatest ./internal/equipo/oficinaid ./internal/equipo/ownermode ./internal/equipo/personapi ./internal/equipo/planning ./internal/equipo/push ./internal/equipo/setup ./internal/equipo/team ./internal/equipo/teamcontract ./internal/equipo/triage ./internal/fakeclaude ./internal/fakecodex ./internal/fakeopencode ./internal/fakepi ./internal/idtest ./internal/ownermodetest ./internal/release ./internal/runner/checks ./internal/runner/connect ./internal/runner/containment ./internal/runner/containment/sysunix ./internal/runner/egress ./internal/runner/forge ./internal/runner/forge/forgetest ./internal/runner/heartbeat ./internal/runner/mac ./internal/runner/mcpresource ./internal/runner/metered ./internal/runner/planflow ./internal/runner/provider ./internal/runner/provider/claude ./internal/runner/provider/codex ./internal/runner/provider/gotoolchain ./internal/runner/provider/opencode ./internal/runner/provider/pi ./internal/runner/setup ./internal/runner/transporttest ./internal/runner/webread ./internal/runner/workspace ./internal/runnerproto ./internal/schedule ./internal/sealbox ./internal/specialist ./internal/stagingtest ./internal/taskplan ./internal/testci ./internal/toolproxy ./internal/websource ./internal/wire ./internal/wire/wireschema ./internal/wire/wiretest ./tools/drive
cache miss: amadan.net/oficina/equipo/internal/copydesk: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/equipo/team: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/forge: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/opencode: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runnerproto: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/testci: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/workspace: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/checks: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/containment: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/pi: its inputs changed
budget note: internal/equipo took 45.275s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/equipo/chat took 12.529s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/idtest took 39.84s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/release took 34.981s, over the 10s the default allows (measured on the run this cached result came from); reported only, timing fails on CI
budget note: internal/runner/containment took 49.264s, over the 15s its record on line 40 allows; reported only, timing fails on CI

receipt: test step 2m31.791s against a 60s target (the gate's other steps are not in this figure)
receipt: 21 packages ran, 40 cached, 18 without tests, 0 failed
receipt: slow package 1m5.234s amadan.net/oficina/equipo/internal/runner/provider/opencode
receipt: slow package 52.281s amadan.net/oficina/equipo/internal/runner/provider/pi
receipt: slow package 51.041s amadan.net/oficina/equipo/internal/runner/checks
receipt: slow package 49.264s amadan.net/oficina/equipo/internal/runner/containment
receipt: slow package 45.275s amadan.net/oficina/equipo/internal/equipo
receipt: slow test 25.94s amadan.net/oficina/equipo/internal/runner/provider/opencode TestOpenCodeAcceptanceHostileRepository
receipt: slow test 21.59s amadan.net/oficina/equipo/internal/runner/containment TestEngineeringOfflineGo
receipt: slow test 15.89s amadan.net/oficina/equipo/cmd/equipo-runner TestReleaseRunnerHasNoFakeWorker
receipt: slow test 11.15s amadan.net/oficina/equipo/internal/runner/containment TestEngineeringMissingModuleCache
receipt: slow test 10.89s amadan.net/oficina/equipo/internal/idtest TestIDCallbackGuardAndPendingNonce
machine: 32 CPUs, load 15.60, cpu waiting 8.61%, memory waiting 0.00%, io waiting 0.08%
--- shard 18 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-chat: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^TestBrowserChat$|^TestBrowserChatSendStaysOnPage$|^TestBrowserComposer$|^TestBrowserComposerReconcile$|^TestBrowserComposerFocus$|^TestBrowserComposerDock$|^TestBrowserDraftStreamsFormatted$|^TestBrowserDraftIsTheMessage$' ./internal/headless
--- FAIL amadan.net/oficina/equipo/internal/headless TestBrowserChat
=== RUN   TestBrowserChat
time=2026-11-22T12:38:04.880Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-22T12:38:04.880Z level=INFO msg="startup phase done" phase=state_lock took=64µs
time=2026-11-22T12:38:04.880Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-22T12:38:04.880Z level=INFO msg="startup phase done" phase=claim_roots took=108µs
time=2026-11-22T12:38:04.880Z level=INFO msg="startup phase" phase=sweep
time=2026-11-22T12:38:04.918Z level=INFO msg="startup phase done" phase=sweep took=37.496ms
time=2026-11-22T12:38:04.918Z level=INFO msg="startup phase" phase=credentials
time=2026-11-22T12:38:04.918Z level=INFO msg="startup phase done" phase=credentials took=105µs
time=2026-11-22T12:38:04.918Z level=INFO msg="startup phase" phase=open_state
time=2026-11-22T12:38:04.980Z level=INFO msg="startup phase done" phase=open_state took=61.914ms
time=2026-11-22T12:38:04.980Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-22T12:38:04.982Z level=INFO msg=connecting host=127.0.0.1:34137 protocol=28
time=2026-11-22T12:38:04.985Z level=INFO msg=connected host=127.0.0.1:34137 took=2.905ms
time=2026-11-22T12:38:04.985Z level=INFO msg="capabilities gathering"
time=2026-11-22T12:38:04.986Z level=INFO msg="capabilities gathered" took=461µs tags=linux,claude,go
time=2026-11-22T12:38:04.988Z level=INFO msg="hello sent" protocol=28
time=2026-11-22T12:38:04.994Z level=INFO msg=welcome protocol=28 role=primary generation=1
rastrillo: budget test: go test failed
time=2026-11-22T12:38:07.310Z level=INFO msg="connection checked" connection=claude-1 state=healthy
    browser_test.go:46: waiting for [...document.querySelectorAll('[equipo-message="incoming"] [equipo-markdown]:not([data-stream-text])')].some(e=>e.textContent.includes('fake coordinator')): context deadline exceeded (last evaluation: <nil>)
--- FAIL: TestBrowserChat (6.38s)

--- FAIL amadan.net/oficina/equipo/internal/headless TestBrowserChatSendStaysOnPage
=== RUN   TestBrowserChatSendStaysOnPage
time=2026-11-22T12:38:11.329Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-22T12:38:11.329Z level=INFO msg="startup phase done" phase=state_lock took=231µs
time=2026-11-22T12:38:11.329Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-22T12:38:11.329Z level=INFO msg="startup phase done" phase=claim_roots took=189µs
time=2026-11-22T12:38:11.329Z level=INFO msg="startup phase" phase=sweep
time=2026-11-22T12:38:11.389Z level=INFO msg="startup phase done" phase=sweep took=59.247ms
time=2026-11-22T12:38:11.389Z level=INFO msg="startup phase" phase=credentials
time=2026-11-22T12:38:11.390Z level=INFO msg="startup phase done" phase=credentials took=567µs
time=2026-11-22T12:38:11.390Z level=INFO msg="startup phase" phase=open_state
time=2026-11-22T12:38:11.457Z level=INFO msg="startup phase done" phase=open_state took=67.016ms
time=2026-11-22T12:38:11.457Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-22T12:38:11.458Z level=INFO msg=connecting host=127.0.0.1:41663 protocol=28
time=2026-11-22T12:38:11.461Z level=INFO msg=connected host=127.0.0.1:41663 took=2.897ms
time=2026-11-22T12:38:11.461Z level=INFO msg="capabilities gathering"
time=2026-11-22T12:38:11.462Z level=INFO msg="capabilities gathered" took=937µs tags=linux,claude,go
time=2026-11-22T12:38:11.463Z level=INFO msg="hello sent" protocol=28
time=2026-11-22T12:38:11.476Z level=INFO msg=welcome protocol=28 role=primary generation=1
time=2026-11-22T12:38:13.621Z level=INFO msg="connection checked" connection=claude-1 state=healthy
    browser_test.go:108: waiting for [...document.querySelectorAll('[equipo-message="incoming"] [equipo-markdown]:not([data-stream-text])')].some(e=>e.textContent.includes('fake coordinator')): context deadline exceeded (last evaluation: context deadline exceeded)
--- FAIL: TestBrowserChatSendStaysOnPage (6.33s)

--- FAIL amadan.net/oficina/equipo/internal/headless TestBrowserDraftIsTheMessage
=== RUN   TestBrowserDraftIsTheMessage
time=2026-11-22T12:38:17.598Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-22T12:38:17.599Z level=INFO msg="startup phase done" phase=state_lock took=153µs
time=2026-11-22T12:38:17.599Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-22T12:38:17.599Z level=INFO msg="startup phase done" phase=claim_roots took=135µs
time=2026-11-22T12:38:17.599Z level=INFO msg="startup phase" phase=sweep
time=2026-11-22T12:38:17.631Z level=INFO msg="startup phase done" phase=sweep took=32.503ms
time=2026-11-22T12:38:17.631Z level=INFO msg="startup phase" phase=credentials
time=2026-11-22T12:38:17.632Z level=INFO msg="startup phase done" phase=credentials took=195µs
time=2026-11-22T12:38:17.632Z level=INFO msg="startup phase" phase=open_state
time=2026-11-22T12:38:17.684Z level=INFO msg="startup phase done" phase=open_state took=52.161ms
time=2026-11-22T12:38:17.685Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-22T12:38:17.687Z level=INFO msg=connecting host=127.0.0.1:37897 protocol=28
time=2026-11-22T12:38:17.688Z level=INFO msg=connected host=127.0.0.1:37897 took=896µs
time=2026-11-22T12:38:17.688Z level=INFO msg="capabilities gathering"
time=2026-11-22T12:38:17.693Z level=INFO msg="capabilities gathered" took=5.068ms tags=linux,claude,go
time=2026-11-22T12:38:17.695Z level=INFO msg="hello sent" protocol=28
time=2026-11-22T12:38:17.752Z level=INFO msg=welcome protocol=28 role=primary generation=1
time=2026-11-22T12:38:19.850Z level=INFO msg="connection checked" connection=claude-1 state=healthy
    browser_thinking_test.go:106: waiting for !!window.__m: context deadline exceeded (last evaluation: context deadline exceeded)
--- FAIL: TestBrowserDraftIsTheMessage (8.17s)

--- FAIL amadan.net/oficina/equipo/internal/headless (package output)
FAIL
rastrillo-budget/v1 ran 49.268s
FAIL	amadan.net/oficina/equipo/internal/headless	49.634s


receipt: test step 50.822s against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 0 cached, 0 without tests, 1 failed
receipt: slow package 49.268s amadan.net/oficina/equipo/internal/headless
receipt: slow test 15.29s amadan.net/oficina/equipo/internal/headless TestBrowserDraftStreamsFormatted
receipt: slow test 8.24s amadan.net/oficina/equipo/internal/headless TestBrowserComposer
receipt: slow test 8.17s amadan.net/oficina/equipo/internal/headless TestBrowserDraftIsTheMessage
receipt: slow test 6.38s amadan.net/oficina/equipo/internal/headless TestBrowserChat
receipt: slow test 6.33s amadan.net/oficina/equipo/internal/headless TestBrowserChatSendStaysOnPage
exit status 1
+ go test -tags browser,testbuild -timeout 15m -run '^TestBrowserChat$|^TestBrowserChatSendStaysOnPage$|^TestBrowserComposer$|^TestBrowserComposerReconcile$|^TestBrowserComposerFocus$|^TestBrowserComposerDock$|^TestBrowserDraftStreamsFormatted$|^TestBrowserDraftIsTheMessage$' -v -run '^TestBrowserChat$|^TestBrowserChatSendStaysOnPage$|^TestBrowserDraftIsTheMessage$' -count=1 ./internal/headless   (retry, once)
##############################################################################
FLAKE ./internal/headless:TestBrowserChat browser-headless-chat 60c5885443bd2f66c0d3ac45ae31eb002efafdbd 6.38s 55.21
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
##############################################################################
FLAKE ./internal/headless:TestBrowserChatSendStaysOnPage browser-headless-chat 60c5885443bd2f66c0d3ac45ae31eb002efafdbd 6.33s 55.21
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
##############################################################################
FLAKE ./internal/headless:TestBrowserDraftIsTheMessage browser-headless-chat 60c5885443bd2f66c0d3ac45ae31eb002efafdbd 8.17s 55.21
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
machine: 32 CPUs, load 43.54, cpu waiting 29.16%, memory waiting 0.00%, io waiting 0.31%
--- shard 19 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-work: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^TestBrowserTaskCard$|^TestBrowserReceiptFollowsReview$|^TestBrowserRailFollowsWork$|^TestBrowserTaskThread$|^TestBrowserAskAfterMerge$|^TestBrowserReceiptsDesktop$|^TestBrowserReceiptsTouch$' ./internal/headless
--- FAIL amadan.net/oficina/equipo/internal/headless TestBrowserRailFollowsWork
=== RUN   TestBrowserRailFollowsWork
time=2026-11-22T12:38:01.644Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-22T12:38:01.644Z level=INFO msg="startup phase done" phase=state_lock took=73µs
time=2026-11-22T12:38:01.644Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-22T12:38:01.644Z level=INFO msg="startup phase done" phase=claim_roots took=87µs
time=2026-11-22T12:38:01.644Z level=INFO msg="startup phase" phase=sweep
time=2026-11-22T12:38:01.673Z level=INFO msg="startup phase done" phase=sweep took=29.111ms
time=2026-11-22T12:38:01.673Z level=INFO msg="startup phase" phase=credentials
time=2026-11-22T12:38:01.673Z level=INFO msg="startup phase done" phase=credentials took=110µs
time=2026-11-22T12:38:01.673Z level=INFO msg="startup phase" phase=open_state
time=2026-11-22T12:38:01.716Z level=INFO msg="startup phase done" phase=open_state took=42.438ms
time=2026-11-22T12:38:01.716Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-22T12:38:01.719Z level=INFO msg=connecting host=127.0.0.1:41635 protocol=28
time=2026-11-22T12:38:01.720Z level=INFO msg=connected host=127.0.0.1:41635 took=1.039ms
time=2026-11-22T12:38:01.720Z level=INFO msg="capabilities gathering"
time=2026-11-22T12:38:01.722Z level=INFO msg="capabilities gathered" took=1.089ms tags=linux,claude,go
time=2026-11-22T12:38:01.722Z level=INFO msg="hello sent" protocol=28
time=2026-11-22T12:38:01.727Z level=INFO msg=welcome protocol=28 role=primary generation=1
time=2026-11-22T12:38:03.044Z level=INFO msg="connection checked" connection=claude-1 state=healthy
time=2026-11-22T12:38:12.414Z level=INFO msg="kept sessions" kept=1 bytes=2770 expired=0
time=2026-11-22T12:38:16.789Z level=INFO msg="kept sessions" kept=2 bytes=4922 expired=0
time=2026-11-22T12:38:17.489Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-22T12:38:17.492Z level=INFO msg="startup phase done" phase=state_lock took=3.206ms
time=2026-11-22T12:38:17.492Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-22T12:38:17.493Z level=INFO msg="startup phase done" phase=claim_roots took=275µs
time=2026-11-22T12:38:17.493Z level=INFO msg="startup phase" phase=sweep
time=2026-11-22T12:38:17.556Z level=INFO msg="startup phase done" phase=sweep took=63.121ms
time=2026-11-22T12:38:17.556Z level=INFO msg="startup phase" phase=credentials
time=2026-11-22T12:38:17.556Z level=INFO msg="startup phase done" phase=credentials took=160µs
time=2026-11-22T12:38:17.556Z level=INFO msg="startup phase" phase=open_state
time=2026-11-22T12:38:17.606Z level=INFO msg="startup phase done" phase=open_state took=49.884ms
time=2026-11-22T12:38:17.607Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-22T12:38:17.608Z level=INFO msg=connecting host=127.0.0.1:40057 protocol=28
time=2026-11-22T12:38:17.609Z level=INFO msg=connected host=127.0.0.1:40057 took=1.016ms
time=2026-11-22T12:38:17.609Z level=INFO msg="capabilities gathering"
time=2026-11-22T12:38:17.611Z level=INFO msg="capabilities gathered" took=1.81ms tags=linux,claude,go
time=2026-11-22T12:38:17.611Z level=INFO msg="hello sent" protocol=28
time=2026-11-22T12:38:17.617Z level=INFO msg=welcome protocol=28 role=primary generation=1
time=2026-11-22T12:38:19.567Z level=INFO msg="connection checked" connection=claude-1 state=healthy
    browser_review_test.go:57: waiting for document.querySelector('#rail [data-specialist="engineering"]')?.dataset.state==='working' && document.querySelector('#rail [data-specialist="engineering"]').querySelector('[equipo-nav-task]')?.textContent==='Slow sidebar change' && document.querySelector('#nav-tasks [data-count]')?.textContent==='1': context deadline exceeded (last evaluation: context deadline exceeded)
time=2026-11-22T12:38:24.213Z level=WARN msg="step account" err="context canceled"
--- FAIL: TestBrowserRailFollowsWork (23.15s)

--- FAIL amadan.net/oficina/equipo/internal/headless (package output)
FAIL
rastrillo-budget/v1 ran 1m36.453s
FAIL	amadan.net/oficina/equipo/internal/headless	96.784s

rastrillo: budget test: go test failed

receipt: test step 1m37.946s against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 0 cached, 0 without tests, 1 failed
receipt: slow package 1m36.453s amadan.net/oficina/equipo/internal/headless
receipt: slow test 26.69s amadan.net/oficina/equipo/internal/headless TestBrowserTaskThread
receipt: slow test 23.15s amadan.net/oficina/equipo/internal/headless TestBrowserRailFollowsWork
receipt: slow test 14.68s amadan.net/oficina/equipo/internal/headless TestBrowserReceiptFollowsReview
receipt: slow test 11.21s amadan.net/oficina/equipo/internal/headless TestBrowserAskAfterMerge
receipt: slow test 10.44s amadan.net/oficina/equipo/internal/headless TestBrowserTaskCard
exit status 1
+ go test -tags browser,testbuild -timeout 15m -run '^TestBrowserTaskCard$|^TestBrowserReceiptFollowsReview$|^TestBrowserRailFollowsWork$|^TestBrowserTaskThread$|^TestBrowserAskAfterMerge$|^TestBrowserReceiptsDesktop$|^TestBrowserReceiptsTouch$' -v -run '^TestBrowserRailFollowsWork$' -count=1 ./internal/headless   (retry, once)
##############################################################################
FLAKE ./internal/headless:TestBrowserRailFollowsWork browser-headless-work 60c5885443bd2f66c0d3ac45ae31eb002efafdbd 23.15s 49.72
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
machine: 32 CPUs, load 36.93, cpu waiting 23.16%, memory waiting 0.00%, io waiting 0.24%
--- shard 20 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-connections: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^TestBrowserConnections|^TestBrowserPasteBox$|^TestBrowserPasteCopiesItsBox$' ./internal/headless

receipt: test step 1m47.637s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m45.986s amadan.net/oficina/equipo/internal/headless
receipt: slow test 17.53s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsConversation
receipt: slow test 13.87s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAdd
receipt: slow test 13.12s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAddPage
receipt: slow test 10.86s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsMeteredLimitRequired
receipt: slow test 10.54s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsOpenCodeGoLimitRequired
machine: 32 CPUs, load 43.54, cpu waiting 30.11%, memory waiting 0.00%, io waiting 0.32%
--- shard 21 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-rest: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserAskAfterMerge|TestBrowserChat|TestBrowserChatSendStaysOnPage|TestBrowserComposer|TestBrowserComposerDock|TestBrowserComposerFocus|TestBrowserComposerReconcile|TestBrowserConnectionsAdd|TestBrowserConnectionsAddPage|TestBrowserConnectionsConversation|TestBrowserConnectionsCopyLink|TestBrowserConnectionsEndedNote|TestBrowserConnectionsMeteredLimitRequired|TestBrowserConnectionsOpenCodeGoLimitRequired|TestBrowserConnectionsSignIn|TestBrowserConnectionsSignInSwitch|TestBrowserConnectionsToken|TestBrowserCopyContinue|TestBrowserCopySettingAndFlag|TestBrowserDraftIsTheMessage|TestBrowserDraftStreamsFormatted|TestBrowserEmptyExplore|TestBrowserMoveIn|TestBrowserNotebook|TestBrowserNotebookLook|TestBrowserPasteBox|TestBrowserPasteBoxLook|TestBrowserPasteCopiesItsBox|TestBrowserRailFollowsWork|TestBrowserReceiptFollowsReview|TestBrowserReceiptsDesktop|TestBrowserReceiptsTouch|TestBrowserRefreshRace|TestBrowserStalePageReloads|TestBrowserTaskCard|TestBrowserTaskThread|TestBrowserThinkingAndCards|TestBrowserUsageAndAdvice|TestBrowserWaitingTurns|TestNotebookScreenshots)$' -skip '^TestBrowserChat$|^TestBrowserChatSendStaysOnPage$|^TestBrowserComposer$|^TestBrowserComposerReconcile$|^TestBrowserComposerFocus$|^TestBrowserComposerDock$|^TestBrowserDraftStreamsFormatted$|^TestBrowserDraftIsTheMessage$|^TestBrowserTaskCard$|^TestBrowserReceiptFollowsReview$|^TestBrowserRailFollowsWork$|^TestBrowserTaskThread$|^TestBrowserAskAfterMerge$|^TestBrowserReceiptsDesktop$|^TestBrowserReceiptsTouch$|^TestBrowserConnections|^TestBrowserPasteBox$|^TestBrowserPasteCopiesItsBox$' ./internal/headless
rastrillo: budget test: go test failed
--- FAIL amadan.net/oficina/equipo/internal/headless TestBrowserEmptyExplore
=== RUN   TestBrowserEmptyExplore
time=2026-11-22T12:38:50.967Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-22T12:38:50.967Z level=INFO msg="startup phase done" phase=state_lock took=156µs
time=2026-11-22T12:38:50.967Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-22T12:38:50.967Z level=INFO msg="startup phase done" phase=claim_roots took=90µs
time=2026-11-22T12:38:50.967Z level=INFO msg="startup phase" phase=sweep
time=2026-11-22T12:38:50.997Z level=INFO msg="startup phase done" phase=sweep took=29.526ms
time=2026-11-22T12:38:50.997Z level=INFO msg="startup phase" phase=credentials
time=2026-11-22T12:38:50.997Z level=INFO msg="startup phase done" phase=credentials took=102µs
time=2026-11-22T12:38:50.997Z level=INFO msg="startup phase" phase=open_state
time=2026-11-22T12:38:51.037Z level=INFO msg="startup phase done" phase=open_state took=40.323ms
time=2026-11-22T12:38:51.038Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-22T12:38:51.039Z level=INFO msg=connecting host=127.0.0.1:43811 protocol=28
time=2026-11-22T12:38:51.040Z level=INFO msg=connected host=127.0.0.1:43811 took=778µs
time=2026-11-22T12:38:51.040Z level=INFO msg="capabilities gathering"
time=2026-11-22T12:38:51.040Z level=INFO msg="capabilities gathered" took=377µs tags=linux,claude,go
time=2026-11-22T12:38:51.041Z level=INFO msg="hello sent" protocol=28
time=2026-11-22T12:38:51.046Z level=INFO msg=welcome protocol=28 role=primary generation=1
time=2026-11-22T12:38:52.146Z level=INFO msg="connection checked" connection=claude-1 state=healthy
    browser_receipts_test.go:169: waiting for [...document.querySelectorAll('[equipo-markdown]:not([data-stream-text])')].some(e=>e.textContent.includes("I'm your coordinator")): context deadline exceeded (last evaluation: <nil>)
--- FAIL: TestBrowserEmptyExplore (5.82s)

--- FAIL amadan.net/oficina/equipo/internal/headless (package output)
FAIL
rastrillo-budget/v1 ran 1m34.913s
FAIL	amadan.net/oficina/equipo/internal/headless	95.228s


receipt: test step 1m36.384s against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 0 cached, 0 without tests, 1 failed
receipt: slow package 1m34.913s amadan.net/oficina/equipo/internal/headless
receipt: slow test 15.2s amadan.net/oficina/equipo/internal/headless TestBrowserThinkingAndCards
receipt: slow test 11.98s amadan.net/oficina/equipo/internal/headless TestBrowserWaitingTurns
receipt: slow test 11.67s amadan.net/oficina/equipo/internal/headless TestBrowserStalePageReloads
receipt: slow test 11.27s amadan.net/oficina/equipo/internal/headless TestBrowserMoveIn
receipt: slow test 8.1s amadan.net/oficina/equipo/internal/headless TestBrowserRefreshRace
exit status 1
+ go test -tags browser,testbuild -timeout 15m -run '^(TestBrowserAskAfterMerge|TestBrowserChat|TestBrowserChatSendStaysOnPage|TestBrowserComposer|TestBrowserComposerDock|TestBrowserComposerFocus|TestBrowserComposerReconcile|TestBrowserConnectionsAdd|TestBrowserConnectionsAddPage|TestBrowserConnectionsConversation|TestBrowserConnectionsCopyLink|TestBrowserConnectionsEndedNote|TestBrowserConnectionsMeteredLimitRequired|TestBrowserConnectionsOpenCodeGoLimitRequired|TestBrowserConnectionsSignIn|TestBrowserConnectionsSignInSwitch|TestBrowserConnectionsToken|TestBrowserCopyContinue|TestBrowserCopySettingAndFlag|TestBrowserDraftIsTheMessage|TestBrowserDraftStreamsFormatted|TestBrowserEmptyExplore|TestBrowserMoveIn|TestBrowserNotebook|TestBrowserNotebookLook|TestBrowserPasteBox|TestBrowserPasteBoxLook|TestBrowserPasteCopiesItsBox|TestBrowserRailFollowsWork|TestBrowserReceiptFollowsReview|TestBrowserReceiptsDesktop|TestBrowserReceiptsTouch|TestBrowserRefreshRace|TestBrowserStalePageReloads|TestBrowserTaskCard|TestBrowserTaskThread|TestBrowserThinkingAndCards|TestBrowserUsageAndAdvice|TestBrowserWaitingTurns|TestNotebookScreenshots)$' -skip '^TestBrowserChat$|^TestBrowserChatSendStaysOnPage$|^TestBrowserComposer$|^TestBrowserComposerReconcile$|^TestBrowserComposerFocus$|^TestBrowserComposerDock$|^TestBrowserDraftStreamsFormatted$|^TestBrowserDraftIsTheMessage$|^TestBrowserTaskCard$|^TestBrowserReceiptFollowsReview$|^TestBrowserRailFollowsWork$|^TestBrowserTaskThread$|^TestBrowserAskAfterMerge$|^TestBrowserReceiptsDesktop$|^TestBrowserReceiptsTouch$|^TestBrowserConnections|^TestBrowserPasteBox$|^TestBrowserPasteCopiesItsBox$' -v -run '^TestBrowserEmptyExplore$' -count=1 ./internal/headless   (retry, once)
##############################################################################
FLAKE ./internal/headless:TestBrowserEmptyExplore browser-headless-rest 60c5885443bd2f66c0d3ac45ae31eb002efafdbd 5.82s 49.72
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
machine: 32 CPUs, load 43.54, cpu waiting 30.11%, memory waiting 0.00%, io waiting 0.32%
--- shard 22 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-rest: ./internal/equipo
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserPreviewBlocksNavigation)$' ./internal/equipo

receipt: test step 2.075s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 573ms amadan.net/oficina/equipo/internal/equipo
receipt: slow test 570ms amadan.net/oficina/equipo/internal/equipo TestBrowserPreviewBlocksNavigation
browser lane browser-rest: ./internal/idtest
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserOficinaIDDoor)$' ./internal/idtest

receipt: test step 2.92s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1.673s amadan.net/oficina/equipo/internal/idtest
receipt: slow test 1.67s amadan.net/oficina/equipo/internal/idtest TestBrowserOficinaIDDoor
browser lane browser-rest: ./internal/plan3test
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestTeamsHierarchyBrowser)$' ./internal/plan3test

receipt: test step 3.327s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1.969s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 1.97s amadan.net/oficina/equipo/internal/plan3test TestTeamsHierarchyBrowser
browser lane browser-rest: ./internal/thintest
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserAccessEmojiByline|TestBrowserAccessFinalOutcomes|TestBrowserAccessRequest|TestBrowserAccessReview|TestBrowserActivitySubjects|TestBrowserAutonomySettings|TestBrowserCoordinatorQueue|TestBrowserEmptyConversation|TestBrowserEndedNoteStaysGone|TestBrowserHousekeeping|TestBrowserInnerGallery|TestBrowserInnerScreens|TestBrowserInstantThinking|TestBrowserInstantThinkingQueued|TestBrowserMachines|TestBrowserPhoneIndex|TestBrowserPlacementQuestionAndPending|TestBrowserProjectPlacement|TestBrowserProjectsList|TestBrowserReportActionFeedback|TestBrowserReportNextSteps|TestBrowserReportThread|TestBrowserRollup|TestBrowserRosterAlignment|TestBrowserRosterDecisionStates|TestBrowserRosterQuietDay|TestBrowserRosterReports|TestBrowserRosterSetAside|TestBrowserRosterSubchat|TestBrowserRosterThinking|TestBrowserRosterVisual|TestBrowserSettingsHousekeepingGroups|TestBrowserSettingsMenu|TestBrowserSettingsRail|TestBrowserSettingsSaveBar|TestBrowserSettingsShots|TestBrowserSettingsStayOnPage|TestBrowserSettingsTeams|TestBrowserShipsButtons|TestBrowserSpecialistRows|TestBrowserSpendFollowsAnswers|TestBrowserTaskRows|TestBrowserTeamPanel|TestBrowserThinkingCycles|TestBrowserThinkingLinesClear|TestBrowserThinkingSteady|TestBrowserThinkingWords|TestBrowserTokenRowEmail|TestBrowserTrackPulse|TestBrowserTrackStarCentre|TestBrowserTryAgain)$' ./internal/thintest

receipt: test step 3m21.762s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 3m20.199s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 17.52s amadan.net/oficina/equipo/internal/thintest TestBrowserAccessRequest
receipt: slow test 14.35s amadan.net/oficina/equipo/internal/thintest TestBrowserSettingsTeams
receipt: slow test 12.02s amadan.net/oficina/equipo/internal/thintest TestBrowserThinkingCycles
receipt: slow test 10.55s amadan.net/oficina/equipo/internal/thintest TestBrowserPlacementQuestionAndPending
receipt: slow test 7.93s amadan.net/oficina/equipo/internal/thintest TestBrowserInnerScreens
machine: 32 CPUs, load 10.88, cpu waiting 5.40%, memory waiting 0.00%, io waiting 0.05%
--- shard 23 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
shard 23: make test-quarantine
python3 scripts/ci-test.py quarantine
quarantine: 12 tests from scripts/ci-quarantine.txt; a failure is retried once, and a pass on the retry is reported as a flake
+ go test -tags testbuild -timeout 15m -v -run '^TestHeadlessConnections$/^A5_cancel_and_sign_out$|^TestHeadlessConnections$/^C4_claude_sign_in$|^TestHeadlessConnections$/^C5_engineering_failover$|^TestHeadlessConnections$/^C5_engineering_to_codex$|^TestHeadlessConnections$/^C5_engineering_waits$' ./internal/headless   (58s)
ok ./internal/headless TestHeadlessConnections/A5_cancel_and_sign_out 5.35s
ok ./internal/headless TestHeadlessConnections/C4_claude_sign_in 1.54s
ok ./internal/headless TestHeadlessConnections/C5_engineering_failover 10.74s
ok ./internal/headless TestHeadlessConnections/C5_engineering_to_codex 11.78s
ok ./internal/headless TestHeadlessConnections/C5_engineering_waits 27.23s
+ go test -tags testbuild -timeout 15m -v -run '^TestHeadlessConnections$/^C5_review_auth$|^TestHeadlessConnections$/^C5_review_failover$|^TestHeadlessConnections$/^C5_review_on_codex$|^TestHeadlessConnections$/^C5_review_other_family_first$' ./internal/headless   (65s)
ok ./internal/headless TestHeadlessConnections/C5_review_auth 20.00s
ok ./internal/headless TestHeadlessConnections/C5_review_failover 13.88s
ok ./internal/headless TestHeadlessConnections/C5_review_on_codex 12.12s
ok ./internal/headless TestHeadlessConnections/C5_review_other_family_first 16.99s
+ go test -tags testbuild -timeout 15m -v -run '^TestMixedVersions$' ./internal/headless   (24s)
ok ./internal/headless TestMixedVersions 22.08s
+ go test -tags testbuild -timeout 15m -v -run '^TestCheckSandboxDeniedPathsTampering$' ./internal/runner/checks   (2s)
ok ./internal/runner/checks TestCheckSandboxDeniedPathsTampering 0.79s
+ go test -tags testbuild -timeout 15m -v -run '^TestRunnerCancelAndSupersede$' ./internal/runner/thin   (1s)
ok ./internal/runner/thin TestRunnerCancelAndSupersede 0.09s
quarantine: 0 flaked (passed on the retry), 0 failed
machine: 32 CPUs, load 53.49, cpu waiting 34.99%, memory waiting 0.00%, io waiting 0.63%
--- shard 24 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
shard 24: make runner-host
python3 scripts/runner-prerequisites.py
CGO_ENABLED=0 RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py retried runner-host -run 'TestDirect|TestProvider|TestCheckSandbox' -count=1 ./internal/runner/provider/... ./internal/runner/checks
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -no-time -run 'TestDirect|TestProvider|TestCheckSandbox' -count=1 ./internal/runner/provider/... ./internal/runner/checks

receipt: test step 11.255s against a 60s target (the gate's other steps are not in this figure)
receipt: 4 packages ran, 0 cached, 3 without tests, 0 failed
receipt: slow package 7.635s amadan.net/oficina/equipo/internal/runner/checks
receipt: slow package 216ms amadan.net/oficina/equipo/internal/runner/provider/claude
receipt: slow package 89ms amadan.net/oficina/equipo/internal/runner/provider/codex
receipt: slow package 1ms amadan.net/oficina/equipo/internal/runner/provider
receipt: slow package 0s amadan.net/oficina/equipo/internal/runner/provider/gotoolchain
receipt: slow test 5.38s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsGoFixture
receipt: slow test 1.77s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPaths
receipt: slow test 360ms amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsCache
receipt: slow test 220ms amadan.net/oficina/equipo/internal/runner/provider/claude TestDirectJournalAdapterBarrier
receipt: slow test 90ms amadan.net/oficina/equipo/internal/runner/provider/codex TestDirectJournalAdapterBarrier
CGO_ENABLED=0 RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py retried runner-host -run '^TestNamespace' -count=1 ./internal/runner/containment
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -no-time -run '^TestNamespace' -count=1 ./internal/runner/containment

receipt: test step 3.258s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 2.886s amadan.net/oficina/equipo/internal/runner/containment
receipt: slow test 290ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceReadOnlyScratch
receipt: slow test 180ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryUnavailableProof
receipt: slow test 110ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceDirectPolicyAdmission
receipt: slow test 100ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceExitStatus
receipt: slow test 100ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryMalformedRecord
machine: 32 CPUs, load 17.56, cpu waiting 7.69%, memory waiting 0.00%, io waiting 1.52%
--- shard 25 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: runner-dead-references started 30s late; cpu waiting 36.6%, load 24.53
shard 25: make runner-dead-references lanes-check build vet fmt-check budget migration-check
python3 scripts/runner-dead-references.py
reference scan: 2541 text files, 2850 matches, 0 failures
python3 scripts/ci-test.py check
lanes: 18 lanes and 5 browser lanes run every test once; 20-check@29
CGO_ENABLED=0 go build ./...
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o /dev/null ./cmd/equipo-runner
go vet ./...
go vet -tags testbuild ./internal/runner/thin ./internal/headless
GOOS=darwin GOARCH=arm64 go vet ./cmd/equipo-runner/... ./internal/runner/... ./internal/wire/... ./internal/release/...
go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget size
budget size: 88 directories within budget
CGO_ENABLED=0 go test ./internal/equipo -run '^TestMigrationModels$' -count=1
ok  	amadan.net/oficina/equipo/internal/equipo	2.527s
machine: 32 CPUs, load 53.49, cpu waiting 34.99%, memory waiting 0.00%, io waiting 0.63%
--- shard 26 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: staticcheck started 30s late; cpu waiting 36.1%, load 24.53
shard 26: make staticcheck
go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 -tags browser,perf,testbuild ./...
machine: 32 CPUs, load 49.74, cpu waiting 26.59%, memory waiting 0.00%, io waiting 0.92%
--- shard 27 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: govulncheck started 30s late; cpu waiting 36.1%, load 24.53
shard 27: make govulncheck
go run golang.org/x/vuln/cmd/govulncheck@v1.8.0 ./...
=== Symbol Results ===

No vulnerabilities found.

Your code is affected by 0 vulnerabilities.
This scan also found 0 vulnerabilities in packages you import and 5
vulnerabilities in modules you require, but your code doesn't appear to call
these vulnerabilities.
Use '-show verbose' for more details.
machine: 32 CPUs, load 42.14, cpu waiting 20.66%, memory waiting 0.00%, io waiting 1.05%
--- shard 28 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: gitleaks started 30s late; cpu waiting 36.1%, load 24.53
shard 28: make gitleaks
12:38PM INF Unknown SCM platform. Use --platform to include links in findings. host=amadan.net
12:38PM INF 1082 commits scanned.
12:38PM INF scanned ~60914442 bytes (60.91 MB) in 21.6s
12:38PM INF no leaks found
machine: 32 CPUs, load 52.88, cpu waiting 30.44%, memory waiting 0.00%, io waiting 0.83%
=== perf ===
go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -no-time -require TestPerfScreens,TestPerfBoot -tags perf -count=1 -p 1 -parallel 1 -run '^TestPerf' ./...
perf: GET /: median 1.132ms, worst 1.164ms, budget 150ms
perf: GET /api/runner/protocol: median 85µs, worst 115µs, budget 150ms
perf: GET /api/v1/account-setups/{id}: median 621µs, worst 662µs, budget 150ms
perf: GET /api/v1/accounts: median 449µs, worst 460µs, budget 150ms
perf: GET /api/v1/auth/devices: median 470µs, worst 486µs, budget 150ms
perf: GET /api/v1/budgets: median 514µs, worst 558µs, budget 150ms
perf: GET /api/v1/capabilities: median 262µs, worst 284µs, budget 150ms
perf: GET /api/v1/cards/{id}: median 1.267ms, worst 1.341ms, budget 150ms
perf: GET /api/v1/connections: median 644µs, worst 700µs, budget 150ms
perf: GET /api/v1/connections/{id}: median 614µs, worst 647µs, budget 150ms
perf: GET /api/v1/conversation: median 971µs, worst 1.038ms, budget 150ms
perf: GET /api/v1/conversation/cards: median 1.681ms, worst 1.827ms, budget 150ms
perf: GET /api/v1/coordinator: median 1.975ms, worst 2.049ms, budget 150ms
perf: GET /api/v1/invites/{id}: median 488µs, worst 543µs, budget 150ms
perf: GET /api/v1/journey: median 8.011ms, worst 8.172ms, budget 150ms
perf: GET /api/v1/me: median 455µs, worst 488µs, budget 150ms
perf: GET /api/v1/me/settings: median 552µs, worst 1.025ms, budget 150ms
perf: GET /api/v1/needs-you: median 7.456ms, worst 8.164ms, budget 150ms
perf: GET /api/v1/notifications: median 1.632ms, worst 1.723ms, budget 150ms
perf: GET /api/v1/onboarding: median 385µs, worst 434µs, budget 150ms
perf: GET /api/v1/people: median 440µs, worst 468µs, budget 150ms
perf: GET /api/v1/playbooks: median 604µs, worst 683µs, budget 150ms
perf: GET /api/v1/playbooks/{id}: median 536µs, worst 577µs, budget 150ms
perf: GET /api/v1/playbooks/{id}/template-diff: median 850µs, worst 913µs, budget 150ms
perf: GET /api/v1/preferences: median 772µs, worst 819µs, budget 150ms
perf: GET /api/v1/projects/{id}: median 453µs, worst 473µs, budget 150ms
perf: GET /api/v1/projects/{id}/settings: median 580µs, worst 625µs, budget 150ms
perf: GET /api/v1/roster: median 476µs, worst 524µs, budget 150ms
perf: GET /api/v1/runners/{id}: median 422µs, worst 485µs, budget 150ms
perf: GET /api/v1/specialists: median 8.035ms, worst 8.255ms, budget 150ms
perf: GET /api/v1/specialists/{id}: median 7.867ms, worst 7.954ms, budget 150ms
perf: GET /api/v1/specialists/{id}/template-diff: median 824µs, worst 859µs, budget 150ms
perf: GET /api/v1/tasks/{id}/plan: median 1.13ms, worst 1.153ms, budget 150ms
perf: GET /api/v1/tasks/{id}/thread: median 700µs, worst 725µs, budget 150ms
perf: GET /api/v1/teams: median 426µs, worst 454µs, budget 150ms
perf: GET /api/v1/templates: median 596µs, worst 606µs, budget 150ms
perf: GET /api/v1/templates/{id}: median 443µs, worst 458µs, budget 150ms
perf: GET /auth/callback: median 70µs, worst 92µs, budget 150ms
perf: GET /auth/devices/{id}: median 3.279ms, worst 3.36ms, budget 150ms
perf: GET /auth/verify: median 79µs, worst 116µs, budget 150ms
perf: GET /connections: median 3.627ms, worst 3.728ms, budget 150ms
perf: GET /conversation: median 7.37ms, worst 7.535ms, budget 150ms
perf: GET /conversation/connections: median 250µs, worst 268µs, budget 150ms
perf: GET /conversation/notebook: median 247µs, worst 275µs, budget 150ms
perf: GET /conversation/settings: median 3.912ms, worst 4.09ms, budget 150ms
perf: GET /conversation/settings/autonomy: median 3.786ms, worst 4.135ms, budget 150ms
perf: GET /conversation/settings/connections: median 6.22ms, worst 6.44ms, budget 150ms
perf: GET /conversation/settings/connections/add: median 6.507ms, worst 6.77ms, budget 150ms
perf: GET /conversation/settings/copy: median 3.558ms, worst 3.733ms, budget 150ms
perf: GET /conversation/settings/housekeeping: median 4.213ms, worst 4.306ms, budget 150ms
perf: GET /conversation/settings/machines: median 4.356ms, worst 4.477ms, budget 150ms
perf: GET /conversation/settings/machines/add: median 4.461ms, worst 4.687ms, budget 150ms
perf: GET /conversation/settings/notebook: median 3.35ms, worst 3.444ms, budget 150ms
perf: GET /conversation/settings/thinking: median 4.01ms, worst 6.343ms, budget 150ms
perf: GET /housekeeping: median 3.923ms, worst 4.019ms, budget 150ms
perf: GET /invites/new: median 592µs, worst 609µs, budget 150ms
perf: GET /invites/{id}: median 626µs, worst 652µs, budget 150ms
perf: GET /jobs: median 3.224ms, worst 3.304ms, budget 150ms
perf: GET /jobs/{id}: median 4.44ms, worst 4.669ms, budget 150ms
perf: GET /journey: median 12.222ms, worst 12.398ms, budget 150ms
perf: GET /nav/rail: median 3.123ms, worst 3.184ms, budget 150ms
perf: GET /needs-you: median 11.797ms, worst 11.878ms, budget 150ms
perf: GET /onboarding: median 4.162ms, worst 4.33ms, budget 150ms
perf: GET /people: median 3.633ms, worst 5.51ms, budget 150ms
perf: GET /playbook-suggestions/{suggestion}: median 5.087ms, worst 5.269ms, budget 150ms
perf: GET /playbooks: median 4.62ms, worst 4.77ms, budget 150ms
perf: GET /playbooks/new: median 4.936ms, worst 5.089ms, budget 150ms
perf: GET /playbooks/{id}: median 4.449ms, worst 4.512ms, budget 150ms
perf: GET /playbooks/{id}/edit: median 4.584ms, worst 4.747ms, budget 150ms
perf: GET /playbooks/{id}/template-diff: median 3.682ms, worst 3.797ms, budget 150ms
perf: GET /preferences: median 4.111ms, worst 4.201ms, budget 150ms
perf: GET /preferences/sources/{source}: median 3.89ms, worst 4.185ms, budget 150ms
perf: GET /projects: median 5.028ms, worst 5.161ms, budget 150ms
perf: GET /projects/accounts: median 3.565ms, worst 3.713ms, budget 150ms
perf: GET /projects/new: median 3.687ms, worst 6.786ms, budget 150ms
perf: GET /projects/{id}: median 10.626ms, worst 11.123ms, budget 150ms
perf: GET /projects/{id}/edit: median 3.732ms, worst 4.058ms, budget 150ms
perf: GET /runners/enrol: median 4.326ms, worst 4.542ms, budget 150ms
perf: GET /settings: median 3.375ms, worst 3.445ms, budget 150ms
perf: GET /settings/coordinator: median 5.394ms, worst 5.613ms, budget 150ms
perf: GET /settings/devices: median 3.203ms, worst 3.328ms, budget 150ms
perf: GET /settings/recovery: median 3.439ms, worst 3.519ms, budget 150ms
perf: GET /settings/recovery/release: median 3.339ms, worst 3.436ms, budget 150ms
perf: GET /settings/thinking: median 248µs, worst 278µs, budget 150ms
perf: GET /signin: median 310µs, worst 341µs, budget 150ms
perf: GET /specialists/new: median 3.292ms, worst 3.498ms, budget 150ms
perf: GET /specialists/{key}: median 11.147ms, worst 12.247ms, budget 150ms
perf: GET /specialists/{key}/edit: median 3.644ms, worst 3.693ms, budget 150ms
perf: GET /specialists/{key}/template-diff: median 3.739ms, worst 3.812ms, budget 150ms
perf: GET /tasks: median 5.292ms, worst 5.396ms, budget 150ms
perf: GET /tasks/new: median 3.215ms, worst 3.301ms, budget 150ms
perf: GET /tasks/{id}: median 5.597ms, worst 5.775ms, budget 150ms
perf: GET /tasks/{id}/merge: median 4.804ms, worst 5.106ms, budget 150ms
perf: GET /tasks/{id}/move: median 4.651ms, worst 4.981ms, budget 150ms
perf: GET /tasks/{id}/plan: median 5.786ms, worst 6.2ms, budget 150ms
perf: GET /tasks/{id}/preview: median 1.589ms, worst 2.973ms, budget 150ms
perf: GET /tasks/{id}/questions/{question}: median 5.324ms, worst 5.453ms, budget 150ms
perf: GET /tasks/{id}/rendered-change: median 4.755ms, worst 5.042ms, budget 150ms
perf: GET /tasks/{id}/rendered-change/{hash}.png: median 4.19ms, worst 4.319ms, budget 150ms
perf: GET /tasks/{id}/thread: median 7.979ms, worst 8.376ms, budget 150ms
perf: GET /team/{specialist}: median 4.34ms, worst 4.473ms, budget 150ms
perf: GET /teams: median 10.056ms, worst 10.293ms, budget 150ms
perf: GET /templates: median 3.355ms, worst 3.445ms, budget 150ms
perf: GET /usage: median 4.233ms, worst 4.331ms, budget 150ms
perf: GET /work: median 3.16ms, worst 5.14ms, budget 150ms
perf: cold boot: median 264ms of [263.926261ms 264.116875ms 264.779765ms], budget 500ms

receipt: test step 39.515s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 84 without tests, 0 failed
receipt: slow package 8.945s amadan.net/oficina/equipo/internal/equipotest
receipt: slow package 0s amadan.net/oficina/equipo/cmd/equipo-runner
receipt: slow package 0s amadan.net/oficina/equipo/cmd/equipo-tool-proxy
receipt: slow package 0s amadan.net/oficina/equipo/internal/advice
receipt: slow package 0s amadan.net/oficina/equipo/internal/attach
receipt: slow test 8.1s amadan.net/oficina/equipo/internal/equipotest TestPerfScreens
receipt: slow test 840ms amadan.net/oficina/equipo/internal/equipotest TestPerfBoot
=== cache ===
ci-box: build cache /home/ci/work/repos/oficina__equipo/cache/go-build: 4.78 GiB in 27199 files
ci-box: module cache /home/ci/work/repos/oficina__equipo/cache/go-mod: 0.87 GiB in 28256 files
ci-box: build cache over 4.0 GiB: dropped 2.07 GiB this job did not read, kept 2.70 GiB
diff --git a/.rastrillo/budgets.txt b/.rastrillo/budgets.txt
index 0433cf4d..ce2d50d6 100644
--- a/.rastrillo/budgets.txt
+++ b/.rastrillo/budgets.txt
@@ -14,7 +14,7 @@ perf GET /* skip Unknown private paths render 404; this fallback contains no scr
time internal/equipo/team 60s Plan 3 loaded CI measured 45.985s; niced serial reruns measured 18.079s and 22.031s. Keep migration, recovery, accounting and concurrency assertions; 60s leaves 30 percent headroom above loaded CI.
time internal/equipotest 300s Final fix package rerun measured 187.035s (review 172.4s); 300s gives 60 percent headroom for HTTP, sandbox, authority and final regression coverage.
-size internal/equipo 21830 - Read-only agent registry and identity checks, with private read context and source-cap propagation; measured 21830 source lines with rastrillo budget size.
+size internal/equipo 21974 - Read-only agent registry and identity checks, with private read context and source-cap propagation; failed-reply reasons and Try again; measured 21974 source lines.
size internal/wire 6771 - Native slice 2 push registrations and set aside, and the instance origin in Live Activity attributes; measured 6771/2972 source/test lines.
size internal/equipotest - 12013 Task 21 repairs historical migration and conversation fixtures after Plan 3; measured 0/12013 source/test lines.
time internal/runner/checks 90s CI worker measured 44.553s (44.6s rounded);
@@ -30,7 +30,7 @@ size internal/runner/provider 5715 - Fable follow-up: base and diagnostic gates,
time internal/plan3test 300s Initial cap for combined browser and runner acceptance; measure at both usable stops.
-size internal/plan3test - 11889 Native identity contracts plus the exact delegated agent-access copy keys; measured 11889 test lines with rastrillo budget size.
+size internal/plan3test - 11891 Native identity contracts plus the exact delegated agent-access copy keys, and the failed-reply review's marker; measured 11891 test lines with rastrillo budget size.
time internal/runner/forge 20s Plan 3 CI repair measured 10.527s for the full package (controller CI 10.407s).
time internal/runner/provider 15s Plan 3 CI repair measured 10.346s for the full package (controller CI 10.709s);
@@ -56,7 +56,7 @@ perf GET /api/v1/tasks/{id} skip Thin v1 person API: bearer-only JSON for device
perf GET /api/v1/assistant/snapshot skip Assistant person API: bearer-only JSON for Base's chat, not a browser screen.
perf GET /api/v1/assistant/messages skip Assistant person API: bearer-only JSON for Base's chat, not a browser screen.
perf GET /api/v1/assistant/events skip Assistant event stream (Server-Sent Events), bearer-only and long-lived; not a screen.
-size internal/equipo/chat 32048 - Native push and activity reads, task source caps, and one private SQL session helper shared by read and tx; measured 32048 source lines with rastrillo budget size.
+size internal/equipo/chat 32283 - Native push and activity reads, task source caps, one private SQL session helper shared by read and tx, and Try again on a failed turn; measured 32283 source lines with rastrillo budget size.
perf GET /api/v1/questions/{id} skip Thin v1 person API: bearer-only JSON for devices; the browser reads questions on /tasks/{id}.
perf GET /api/v1/steps/{id}/log skip Thin v1 person API: bearer-only JSON for devices; the browser shows the log tail on /tasks/{id}.
perf GET /api/v1/connections/preference skip Connections slice 1 person API: bearer-only JSON for devices; the browser shows the preference on /conversation/connections.
@@ -71,7 +71,7 @@ perf GET /tasks/{id}/files/{file} skip Research kept images: the bytes of one im
perf GET /api/v1/runners skip Mac runners person API: bearer-only JSON for devices; the browser shows runners in the Team section.
time cmd/equipo-runner 60s TestReleaseRunnerHasNoFakeWorker builds the release runner and the thin package under testbuild (about 12s locally).
size internal/headless - 11319 Fable follow-up: base and diagnostic gates, preview isolation and provenance guards; live staging witnesses; measured 0/11319 source/test lines (live first-stage check).
-size internal/thintest - 32620 Fable follow-up: base and diagnostic gates, preview isolation and provenance guards; empty conversation page and browser checks; measured 1515/32338 source/test lines.
+size internal/thintest - 33399 Fable follow-up gates, preview isolation and provenance guards; empty conversation page and browser checks; Try again contracts; measured 1520/33399 source/test lines.
perf GET /api/v1/projects/{id}/merge-policy skip Merge authority person API: bearer-only JSON for devices; the browser reads the policy on /projects/{id}.
perf GET /api/v1/usage skip Thin v1 person API: bearer-only JSON for devices; the browser reads usage through /usage.
diff --git a/docs/api/equipo-v1.openapi.json b/docs/api/equipo-v1.openapi.json
index 7589969c..f403875d 100644
--- a/docs/api/equipo-v1.openapi.json
+++ b/docs/api/equipo-v1.openapi.json
@@ -13141,6 +13141,68 @@
}
}
},
+ "/turns/{id}/retry": {
+ "post": {
+ "operationId": "post_turns_id_retry",
+ "summary": "Try a failed turn again",
+ "description": "202 with a new turn, the failed turn's next attempt. The failed turn's messages move to it: each message's `turn_id` becomes the new turn's, with a `message` event, and the failed turn keeps its `reason` with no `message_ids`. What the failed attempt already did is not done again. Asked again, it is the same turn. Only your latest turn in the conversation can be tried again, once it has failed: 409 `not_retryable` when it did not fail, failed with `attachment_unavailable`, `runner_storage_full` or `runner_too_old`, or a newer turn followed it. No body is read.",
+ "security": [
+ {
+ "personBearer": []
+ }
+ ],
+ "parameters": [
+ {
+ "name": "id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "minLength": 1
+ }
+ }
+ ],
+ "responses": {
+ "202": {
+ "description": "Accepted",
+ "headers": {
+ "Cache-Control": {
+ "schema": {
+ "const": "no-store"
+ }
+ }
+ },
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Turn"
+ }
+ }
+ }
+ },
+ "401": {
+ "$ref": "#/components/responses/unauthenticated"
+ },
+ "default": {
+ "description": "An error, with one of the codes in `Error`",
+ "headers": {
+ "Cache-Control": {
+ "schema": {
+ "const": "no-store"
+ }
+ }
+ },
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
"/usage": {
"get": {
"operationId": "get_usage",
diff --git a/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md b/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md
index d165ed72..0c725cc4 100644
--- a/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md
+++ b/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md
@@ -6783,6 +6783,19 @@ records remain unchanged.
| `agent.equipo_task_get` | Read one task and its current details. | Agent operation description. Reads one task and its current details from the existing authorised read path. (agent access, 2026-11-20; Luna, codex gpt-5.6-luna, house rules) | COPY ACCEPTED BY DELEGATION (Luna, 2026-11-20) |
| `agent.equipo_needs_you` | Read this person's recent unfinished tasks with a decision. | Agent operation description. Reads this person's recent nonterminal tasks that have a nonempty decision field. The existing source scans up to 100 recent tasks before filtering; not an all-history claim. (agent access, 2026-11-20; Luna, codex gpt-5.6-luna, house rules) | COPY ACCEPTED BY DELEGATION (Luna, 2026-11-20) |
| `docs/api/equipo-v1.md / Delegated read-only operations` | ## Delegated read-only operations<br><br>Oficina Connect credentials use the separate [agent-access interface](agent-access.md).<br>It lists active projects and recent tasks, reads one task, and reads Needs you. | API documentation section for device-client developers, linking to the separate read-only delegated-agent interface. Preserve the Markdown link and technical facts. (agent access, 2026-11-20; Luna, codex gpt-5.6-luna, house rules) | Document section; COPY ACCEPTED BY DELEGATION (Luna, 2026-11-20) |
+| `chat.failed.turn_timeout` | The reply ran out of time on your runner. Try again, or ask for less at once. | Conversation: the note under a reply that failed, turn_timeout (failed-reply reasons, 2026-11-22) | Runtime; COPY APPROVED (Paul, 2026-11-22, copy-review ipgtz3lqoo3rj6rpiodpekh6vu, unchanged) |
+| `chat.failed.runner_restarted` | Your runner stopped before it could reply. Try again. | Conversation: the note under a reply that failed, runner_restarted and interrupted (failed-reply reasons, 2026-11-22) | Runtime; COPY APPROVED (Paul, 2026-11-22, copy-review ipgtz3lqoo3rj6rpiodpekh6vu, unchanged) |
+| `chat.failed.provider_failed` | {account} stopped before finishing the reply. Try again. | Conversation: the note under a reply that failed, provider_failed; {account} is the account label, else chat.failed.the_model (failed-reply reasons, 2026-11-22) | Runtime; COPY APPROVED (Paul, 2026-11-22, copy-review ipgtz3lqoo3rj6rpiodpekh6vu, unchanged) |
+| `chat.failed.account_unavailable` | Your runner could not open {account} for this reply. Try again. | Conversation: the note under a reply that failed, account_unavailable; {account} is the account label, else chat.failed.an_account (failed-reply reasons, 2026-11-22) | Runtime; COPY APPROVED (Paul, 2026-11-22, copy-review ipgtz3lqoo3rj6rpiodpekh6vu, unchanged) |
+| `chat.failed.sign_in_again` | {account} needs you to sign in again. | Conversation: the note under a reply that failed, sign_in_again, only when the account is known, beside Sign in again (failed-reply reasons, 2026-11-22) | Runtime; COPY APPROVED (Paul, 2026-11-22, copy-review ipgtz3lqoo3rj6rpiodpekh6vu, unchanged) |
+| `chat.failed.limited` | {account} reached its usage limit. Try again once it resets, or add another account. | Conversation: the note under a reply that failed, limited, only when the account is known; Try again once its limit has reset (failed-reply reasons, 2026-11-22) | Runtime; COPY APPROVED (Paul, 2026-11-22, copy-review ipgtz3lqoo3rj6rpiodpekh6vu, unchanged) |
+| `chat.failed.policy_rejected` | A safety check on your runner stopped this reply. Try again, and if it keeps happening, update your runner. | Conversation: the note under a reply that failed, policy_rejected (failed-reply reasons, 2026-11-22) | Runtime; COPY APPROVED (Paul, 2026-11-22, copy-review ipgtz3lqoo3rj6rpiodpekh6vu, unchanged) |
+| `chat.failed.provider_rejected` | {account} could not work with the message as sent. Try again, or send it without attachments. | Conversation: the note under a reply that failed, provider_rejected; {account} is the account label, else chat.failed.the_model (failed-reply reasons, 2026-11-22) | Runtime; COPY APPROVED (Paul, 2026-11-22, copy-review ipgtz3lqoo3rj6rpiodpekh6vu, unchanged) |
+| `chat.failed.attachment_unavailable` | A file did not arrive whole on your runner. Attach it again. | Conversation: the note under a reply that failed, attachment_unavailable; no Try again (failed-reply reasons, 2026-11-22) | Runtime; COPY APPROVED (Paul, 2026-11-22, copy-review ipgtz3lqoo3rj6rpiodpekh6vu, unchanged) |
+| `chat.failed.runner_too_old` | Your runner is too old for this conversation. Update it, then try again. | Conversation: the note under a reply that failed, runner_too_old (Assistant and job threads); no Try again (failed-reply reasons, 2026-11-22) | Runtime; COPY APPROVED (Paul, 2026-11-22, copy-review ipgtz3lqoo3rj6rpiodpekh6vu, unchanged) |
+| `chat.failed.the_model` | The model | Conversation: the note under a reply that failed, the fill-in for {account} at the start of a line when the account is unknown (failed-reply reasons, 2026-11-22) | Runtime; COPY APPROVED (Paul, 2026-11-22, copy-review ipgtz3lqoo3rj6rpiodpekh6vu, unchanged) |
+| `chat.failed.an_account` | an account | Conversation: the note under a reply that failed, the fill-in for {account} inside a line when the account is unknown (failed-reply reasons, 2026-11-22) | Runtime; COPY APPROVED (Paul, 2026-11-22, copy-review ipgtz3lqoo3rj6rpiodpekh6vu, unchanged) |
+| `chat.failed.retry` | Try again | Conversation: the note under a reply that failed, the button in the note under a failed reply (failed-reply reasons, 2026-11-22) | Runtime; COPY APPROVED (Paul, 2026-11-22, copy-review ipgtz3lqoo3rj6rpiodpekh6vu, unchanged) |
## Task 21
diff --git a/internal/equipo/app.go b/internal/equipo/app.go
index 961cb851..2bdabd65 100644
--- a/internal/equipo/app.go
+++ b/internal/equipo/app.go
@@ -357,6 +357,7 @@ func RouterWithStore(d *db.DB, cfg Config, mailer mail.Sender, logger *slog.Logg
r.Post("/conversation/cards/{id}/visibility", a.chatCardVisibility)
r.Post("/conversation/cards/{id}/reply", a.chatCardReply)
r.Post("/conversation/turns/{id}/stop", a.chatTurnStop)
+ r.Post("/conversation/turns/{id}/retry", a.chatTurnRetry)
if store.oficina != nil {
r.Get(oficinaStartPath, a.oficinaStart)
r.Get(oficinaDonePath, a.oficinaDone)
diff --git a/internal/equipo/chat/http.go b/internal/equipo/chat/http.go
index 7f0741c4..010e3d26 100644
--- a/internal/equipo/chat/http.go
+++ b/internal/equipo/chat/http.go
@@ -80,6 +80,7 @@ func (h *HTTP) Mount(r chi.Router) {
r.Get("/attachments/{id}/preview", h.bearer(h.attachment(true)))
r.Get("/turns/{id}", h.bearer(h.turn))
r.Post("/turns/{id}/cancel", h.bearer(h.cancel))
+ r.Post("/turns/{id}/retry", h.bearer(h.retry))
r.Get("/snapshot", h.bearer(h.snapshot))
r.Get("/projects", h.bearer(h.projects))
r.Post("/projects", h.bearer(h.addProject))
@@ -583,6 +584,18 @@ func (h *HTTP) cancel(w http.ResponseWriter, r *http.Request, p personapi.Person
h.cancelWith(w, r, p, h.Store.Cancel)
}
+// retry is POST /turns/{id}/retry (Try again): 202 with the turn that
+// answers the failed turn's messages again, the same turn when asked
+// again; 409 not_retryable when the turn cannot be tried again.
+func (h *HTTP) retry(w http.ResponseWriter, r *http.Request, p personapi.PersonPrincipal) {
+ out, err := h.Store.Retry(r.Context(), p.Address, chi.URLParam(r, "id"))
+ if err != nil {
+ h.fail(w, r, err)
+ return
+ }
+ writeJSON(w, http.StatusAccepted, out)
+}
+
// cancelWith is POST turns/{id}/cancel in a lane: 202, or 409 turn_ended.
func (h *HTTP) cancelWith(w http.ResponseWriter, r *http.Request, p personapi.PersonPrincipal, cancel func(context.Context, string, string) (int64, wire.Turn, error)) {
attempt, current, err := cancel(r.Context(), p.Address, chi.URLParam(r, "id"))
diff --git a/internal/equipo/chat/models.go b/internal/equipo/chat/models.go
index ae54e7cd..2c089f09 100644
--- a/internal/equipo/chat/models.go
+++ b/internal/equipo/chat/models.go
@@ -40,6 +40,9 @@ type turnRecord struct {
Lane string
// Note is a team_update turn's text: the summary it tells.
Note string
+ // RetryOf is the failed turn this turn tried again (Try again): its
+ // exchange moved here (Retry). It is never read to dispatch.
+ RetryOf string
}
func (turnRecord) TableName() string { return "chat_turns" }
diff --git a/internal/equipo/chat/retry.go b/internal/equipo/chat/retry.go
new file mode 100644
index 00000000..6b4741c6
--- /dev/null
+++ b/internal/equipo/chat/retry.go
@@ -0,0 +1,219 @@
+package chat
+
+import (
+ "context"
+ "errors"
+ "slices"
+
+ "gorm.io/gorm"
+
+ "amadan.net/oficina/equipo/internal/wire"
+)
+
+// Try again: the person's latest turn in the conversation failed, and
+// they ask for it to be answered again. A new turn takes over the failed
+// turn's exchange: its messages, the cards it raised and their threads,
+// the tasks it noted, its tool calls, its hand-off and the steps it asked
+// for, and what it spent: a repository creation it used (CreateRepo).
+// Every check that reads a turn's messages, cards or calls by its id
+// (placement, consent, access, quote, dispatch) then reads them on the
+// new turn as they were, and an instance that knows nothing of retries
+// (a rollback) dispatches it as any queued turn. It is the failed turn's
+// next attempt: what that turn already did is answered from the ledger,
+// not done twice (earlierOp). Every member hears of a moved task, step or
+// card at a new revision. The failed turn keeps its reason and usage, and
+// has no messages left: the feed shows each once, and no note stays
+// under it. RetryOf names it. A specialist it proposed keeps naming it:
+// nothing reads that, and a specialist's grant holds at one revision.
+
+// notRetried are the reasons another try cannot mend: a file to attach
+// again, room on the runner, a runner to update.
+var notRetried = map[string]bool{
+ wire.ReasonAttachmentUnavailable: true,
+ wire.ReasonStorageFull: true,
+ reasonRunnerTooOld: true,
+}
+
+// Retryable reports whether a failed turn with this reason may be tried
+// again.
+func Retryable(reason string) bool { return !notRetried[reason] }
+
+// retryMoves are the rows of a turn's exchange no client sees, by table
+// and turn column: they go with it to its retry as they are. Messages,
+// cards, threads, tasks and steps move with their events (moveExchange).
+var retryMoves = [][2]string{{"chat_tool_calls", "turn_id"}, {"chat_handoff_turns", "turn_id"}}
+
+// Retry queues a new turn for the exchange of id, the person's latest
+// turn in the conversation, which failed. Asked again (a double tap, a
+// second device, at once), it is the same turn: one is queued. It is
+// refused (ErrNotRetryable) for a turn that did not fail, failed for a
+// reason another try cannot mend, or that a newer turn of theirs
+// followed. Authority is a message's: the current person, in their own
+// lane.
+func (s *Store) Retry(ctx context.Context, person, id string) (out wire.Turn, err error) {
+ err = s.tx(ctx, func(t *txn) error {
+ if err := s.authority.CurrentPerson(ctx, t.db); err != nil {
+ return err
+ }
+ var f turnRecord
+ if err := t.db.Where("id = ? AND person = ? AND coalesce(lane, '') = ? AND coalesce(kind, '') = ''", id, person, wire.LaneCoordinator).First(&f).Error; errors.Is(err, gorm.ErrRecordNotFound) {
+ return ErrNotFound
+ } else if err != nil {
+ return err
+ }
+ var newer turnRecord
+ if err := t.db.Where("person = ? AND coalesce(lane, '') = ? AND coalesce(kind, '') = '' AND (created_at > ? OR created_at = ? AND id > ?)", person, f.Lane, f.CreatedAt, f.CreatedAt, f.ID).Order("created_at, id").Limit(1).Find(&newer).Error; err != nil {
+ return err
+ }
+ if newer.ID != "" {
+ // Tried again already: that turn, whatever became of it.
+ if newer.RetryOf == f.ID {
+ out, err = t.turnView(newer)
+ return err
+ }
+ return ErrNotRetryable
+ }
+ if f.State != wire.TurnFailed || !Retryable(f.Reason) {
+ return ErrNotRetryable
+ }
+ var messages []messageRecord
+ if err := t.db.Where("turn_id = ? AND person = ?", f.ID, person).Order("seq").Find(&messages).Error; err != nil {
+ return err
+ }
+ if !slices.ContainsFunc(messages, func(m messageRecord) bool { return m.Role == wire.RolePerson }) {
+ return ErrNotRetryable
+ }
+ now := t.now()
+ r := turnRecord{ID: newID("t_"), Person: person, State: wire.TurnQueued, Attempt: f.Attempt + 1, CreatedAt: now, UpdatedAt: now, Lane: f.Lane, RetryOf: f.ID, CreateRepo: f.CreateRepo}
+ if err := t.db.Create(&r).Error; err != nil {
+ return err
+ }
+ if err := t.moveExchange(f, r, messages); err != nil {
+ return err
+ }
+ // As a message does: the person's tap ends quiet hours, and a
+ // move-in or explore turn in flight gives way.
+ if err := t.hkRelease(person, t.hkNow()); err != nil {
+ return err
+ }
+ busy, err := t.inFlight(person, r.Lane)
+ if err != nil {
+ return err
+ }
+ if busy == 0 {
+ err = t.dispatch(&r)
+ } else {
+ err = t.yieldTurns(person)
+ }
+ if err != nil {
+ return err
+ }
+ if err := t.saveTurn(&r); err != nil {
+ return err
+ }
+ out, err = t.turnView(r)
+ return err
+ })
+ return out, err
+}
+
+// moveExchange gives f's exchange to r (see Retry), telling clients of
+// each message, card, task and step that moved, and of f, which has none
+// left.
+func (t *txn) moveExchange(f, r turnRecord, messages []messageRecord) error {
+ for _, m := range messages {
+ m.TurnID = r.ID
+ m.Revision++
+ if err := t.db.Model(&messageRecord{}).Where("seq = ?", m.Seq).Select("turn_id", "revision").Updates(&m).Error; err != nil {
+ return err
+ }
+ if err := t.messageEvent(m); err != nil {
+ return err
+ }
+ }
+ // A card it raised, or one whose thread holds its words.
+ var cards []cardRecord
+ if err := t.db.Where("person = ? AND (turn_id = ? OR id IN (SELECT card_id FROM chat_card_threads WHERE turn_id = ?))", f.Person, f.ID, f.ID).Find(&cards).Error; err != nil {
+ return err
+ }
+ if err := t.db.Exec("UPDATE chat_card_threads SET turn_id = ? WHERE turn_id = ?", r.ID, f.ID).Error; err != nil {
+ return err
+ }
+ for _, c := range cards {
+ if c.TurnID == f.ID {
+ c.TurnID = r.ID
+ }
+ c.Revision, c.UpdatedAt = c.Revision+1, t.now()
+ if err := t.db.Model(&cardRecord{}).Where("id = ?", c.ID).Select("turn_id", "revision", "updated_at").Updates(&c).Error; err != nil {
+ return err
+ }
+ if err := t.cardEventPush(c, false); err != nil {
+ return err
+ }
+ }
+ var tasks []taskRecord
+ if err := t.db.Where("turn_id = ?", f.ID).Find(&tasks).Error; err != nil {
+ return err
+ }
+ for _, k := range tasks {
+ if err := t.db.Model(&taskRecord{}).Where("id = ?", k.ID).Update("turn_id", r.ID).Error; err != nil {
+ return err
+ }
+ k.TurnID = r.ID
+ if err := t.saveTask(&k); err != nil {
+ return err
+ }
+ }
+ var steps []stepRecord
+ if err := t.db.Where("request_turn = ?", f.ID).Find(&steps).Error; err != nil {
+ return err
+ }
+ for _, st := range steps {
+ st.RequestTurn = r.ID
+ if err := t.writeStep(&st); err != nil {
+ return err
+ }
+ }
+ for _, move := range retryMoves {
+ if err := t.db.Exec("UPDATE "+move[0]+" SET "+move[1]+" = ? WHERE "+move[1]+" = ?", r.ID, f.ID).Error; err != nil {
+ return err
+ }
+ }
+ f.Revision++
+ f.UpdatedAt = t.now()
+ if err := t.db.Model(&turnRecord{}).Where("id = ?", f.ID).Select("revision", "updated_at").Updates(&f).Error; err != nil {
+ return err
+ }
+ return t.turnEvent(f)
+}
+
+// TurnAccount is the account one of the person's turns last ran on, as
+// its usage rows record it: the connection and its label. ok is false
+// when no row names one of their connections: the turn ended before an
+// account was chosen, or the connection is gone.
+func (s *Store) TurnAccount(ctx context.Context, person, turn string) (conn wire.Connection, label ConnLabel, ok bool, err error) {
+ err = s.read(ctx, func(tx *gorm.DB) error {
+ if err := s.authority.CurrentPerson(ctx, tx); err != nil {
+ return err
+ }
+ var u usageRecord
+ if err := tx.Where("person = ? AND turn_id = ? AND coalesce(connection, '') <> ''", person, turn).Order("attempt DESC, id DESC").Limit(1).Find(&u).Error; err != nil || u.ID == 0 {
+ return err
+ }
+ t := &txn{s: s, db: tx}
+ recs, err := t.connections(person)
+ if err != nil {
+ return err
+ }
+ // A usage row names the runner's local id (as the Usage page reads
+ // it): the first connection with it.
+ for _, r := range recs {
+ if r.LocalID == u.Connection {
+ conn, label, ok = connectionView(r), labelsOf(recs, t.copyOf)[r.ID], true
+ return nil
+ }
+ }
+ return nil
+ })
+ return conn, label, ok, err
+}
diff --git a/internal/equipo/chat_failed.go b/internal/equipo/chat_failed.go
new file mode 100644
index 00000000..bdfb60f1
--- /dev/null
+++ b/internal/equipo/chat_failed.go
@@ -0,0 +1,132 @@
+package equipo
+
+import (
+ "context"
+ "errors"
+ "net/http"
+ "strings"
+ "time"
+
+ "github.com/go-chi/chi/v5"
+
+ "amadan.net/oficina/equipo/internal/equipo/chat"
+ "amadan.net/oficina/equipo/internal/wire"
+)
+
+// chatEnded is the note under the person's latest turn when it ended
+// unanswered: what happened, then the one thing to do about it. Retry
+// offers Try again (chatTurnRetry); SignIn is where to sign in again.
+type chatEnded struct {
+ ID, Line string
+ Retry bool
+ SignIn string
+}
+
+// failedAccount is the account a failed turn last ran on (from its usage
+// rows): its connection, label, state and when its limit resets.
+type failedAccount struct {
+ ID, Label, State string
+ ResetsAt *time.Time
+}
+
+// namesAccount are the failures whose line names the account.
+var namesAccount = map[string]bool{"provider_failed": true, "account_unavailable": true, "sign_in_again": true, "limited": true, "provider_rejected": true}
+
+// signInPage is where a connection is signed in again.
+const signInPage = "/conversation/settings/connections"
+
+// endedNote is the note for t, a person turn that failed or was stopped;
+// acct is the account it last ran on, nil when Equipo does not know it.
+func endedNote(t wire.Turn, acct *failedAccount, now time.Time) chatEnded {
+ n := chatEnded{ID: t.ID}
+ if t.State != wire.TurnFailed {
+ n.Line = copyText("chat." + t.State)
+ return n
+ }
+ // A batch (messages sent while another turn ran) says them all.
+ fallback := "chat.failed"
+ if len(t.MessageIDs) > 1 {
+ fallback = "chat.failed_many"
+ }
+ named := func(unknown string) string {
+ who := copyText(unknown)
+ if acct != nil {
+ who = acct.Label
+ }
+ return strings.ReplaceAll(copyText("chat.failed."+t.Reason), "{account}", who)
+ }
+ switch t.Reason {
+ case "turn_timeout", "policy_rejected":
+ n.Line, n.Retry = copyText("chat.failed."+t.Reason), true
+ case "runner_restarted", "interrupted":
+ n.Line, n.Retry = copyText("chat.failed.runner_restarted"), true
+ case "provider_failed", "provider_rejected":
+ n.Line, n.Retry = named("chat.failed.the_model"), true
+ case "account_unavailable":
+ n.Line, n.Retry = named("chat.failed.an_account"), true
+ case "sign_in_again":
+ // Another try fails the same way until the account is signed in.
+ n.Line, n.SignIn = copyText(fallback), signInPage
+ if acct != nil {
+ n.Line, n.SignIn = named(""), signInPage+"#connection-"+acct.ID
+ }
+ case "limited":
+ // Try again only once the limit has reset, as far as Equipo knows.
+ n.Line = copyText(fallback)
+ if acct != nil {
+ n.Line = named("")
+ n.Retry = acct.State == wire.ConnHealthy || acct.ResetsAt != nil && !now.Before(*acct.ResetsAt)
+ }
+ case wire.ReasonAttachmentUnavailable, "runner_too_old":
+ n.Line = copyText("chat.failed." + t.Reason)
+ case wire.ReasonStorageFull:
+ n.Line = copyText("chat.failed_storage")
+ default:
+ n.Line, n.Retry = copyText(fallback), true
+ }
+ return n
+}
+
+// endedFor is the note for the person's latest turn, with the account it
+// last ran on when its line names one.
+func (a *application) endedFor(ctx context.Context, address string, t wire.Turn) (*chatEnded, error) {
+ var acct *failedAccount
+ if t.State == wire.TurnFailed && namesAccount[t.Reason] {
+ conn, label, ok, err := a.store.Chat().TurnAccount(ctx, address, t.ID)
+ if err != nil {
+ return nil, err
+ }
+ if ok {
+ acct = &failedAccount{ID: conn.ID, Label: label.Named, State: conn.State}
+ if conn.Headroom != nil {
+ acct.ResetsAt = conn.Headroom.ResetsAt
+ }
+ }
+ }
+ n := endedNote(t, acct, a.store.Chat().Now())
+ return &n, nil
+}
+
+// chatTurnRetry is Try again under a failed reply: the retry a device
+// makes. Tried again already, or overtaken by a newer turn, the page
+// shows how things stand; a script reads 409.
+func (a *application) chatTurnRetry(w http.ResponseWriter, r *http.Request) {
+ w.Header().Set("Cache-Control", "no-store")
+ ctx, address, ok := sessionContext(r)
+ if !ok {
+ a.failure(w, r, ErrForbidden)
+ return
+ }
+ _, err := a.store.Chat().Retry(ctx, address, chi.URLParam(r, "id"))
+ script := strings.Contains(r.Header.Get("Accept"), "application/json")
+ switch {
+ case err != nil && !errors.Is(err, chat.ErrNotRetryable):
+ a.failure(w, r, chatError(err))
+ case err != nil && script:
+ runnerJSON(w, http.StatusConflict, struct{}{})
+ case script:
+ runnerJSON(w, http.StatusOK, struct{}{})
+ default:
+ http.Redirect(w, r, "/conversation", http.StatusSeeOther)
+ }
+}
diff --git a/internal/equipo/chat_failed_test.go b/internal/equipo/chat_failed_test.go
new file mode 100644
index 00000000..ec9b84ca
--- /dev/null
+++ b/internal/equipo/chat_failed_test.go
@@ -0,0 +1,79 @@
+package equipo
+
+import (
+ "testing"
+ "time"
+
+ "amadan.net/oficina/equipo/internal/wire"
+)
+
+// The note under a failed reply says why in the approved words (Paul's
+// copy review, 2026-11-22), names the account where Equipo knows it, and
+// offers the one thing to do: Try again, Sign in again, or nothing.
+func TestFailedNoteByReason(t *testing.T) {
+ now := time.Date(2026, 11, 22, 12, 0, 0, 0, time.UTC)
+ past, future := now.Add(-time.Minute), now.Add(time.Hour)
+ known := &failedAccount{ID: "cn_1", Label: "Claude (pabqas@gmail.com)", State: wire.ConnHealthy}
+ limited := func(at *time.Time) *failedAccount {
+ return &failedAccount{ID: "cn_1", Label: "Claude (pabqas@gmail.com)", State: wire.ConnLimited, ResetsAt: at}
+ }
+ one, many := []string{"m1"}, []string{"m1", "m2"}
+ const (
+ none = ""
+ retry = "retry"
+ )
+ for _, c := range []struct {
+ name, reason string
+ ids []string
+ acct *failedAccount
+ line, action string
+ }{
+ {"timeout", "turn_timeout", one, nil, "The reply ran out of time on your runner. Try again, or ask for less at once.", retry},
+ {"restarted", "runner_restarted", one, nil, "Your runner stopped before it could reply. Try again.", retry},
+ {"interrupted", "interrupted", many, nil, "Your runner stopped before it could reply. Try again.", retry},
+ {"provider failed, known", "provider_failed", one, known, "Claude (pabqas@gmail.com) stopped before finishing the reply. Try again.", retry},
+ {"provider failed, unknown", "provider_failed", one, nil, "The model stopped before finishing the reply. Try again.", retry},
+ {"account unavailable, known", "account_unavailable", one, known, "Your runner could not open Claude (pabqas@gmail.com) for this reply. Try again.", retry},
+ {"account unavailable, unknown", "account_unavailable", one, nil, "Your runner could not open an account for this reply. Try again.", retry},
+ {"sign in again, known", "sign_in_again", one, known, "Claude (pabqas@gmail.com) needs you to sign in again.", "/conversation/settings/connections#connection-cn_1"},
+ {"sign in again, unknown", "sign_in_again", one, nil, "The coordinator could not answer this message.", "/conversation/settings/connections"},
+ {"sign in again, unknown batch", "sign_in_again", many, nil, "The coordinator could not answer these messages.", "/conversation/settings/connections"},
+ {"limited, resets later", "limited", one, limited(&future), "Claude (pabqas@gmail.com) reached its usage limit. Try again once it resets, or add another account.", none},
+ {"limited, reset", "limited", one, limited(&past), "Claude (pabqas@gmail.com) reached its usage limit. Try again once it resets, or add another account.", retry},
+ {"limited, reset unknown", "limited", one, limited(nil), "Claude (pabqas@gmail.com) reached its usage limit. Try again once it resets, or add another account.", none},
+ {"limited, healthy again", "limited", one, known, "Claude (pabqas@gmail.com) reached its usage limit. Try again once it resets, or add another account.", retry},
+ {"limited, unknown", "limited", many, nil, "The coordinator could not answer these messages.", none},
+ {"policy", "policy_rejected", one, nil, "A safety check on your runner stopped this reply. Try again, and if it keeps happening, update your runner.", retry},
+ {"provider rejected, known", "provider_rejected", one, known, "Claude (pabqas@gmail.com) could not work with the message as sent. Try again, or send it without attachments.", retry},
+ {"provider rejected, unknown", "provider_rejected", one, nil, "The model could not work with the message as sent. Try again, or send it without attachments.", retry},
+ {"attachment", "attachment_unavailable", one, nil, "A file did not arrive whole on your runner. Attach it again.", none},
+ {"too old", "runner_too_old", one, nil, "Your runner is too old for this conversation. Update it, then try again.", none},
+ {"storage", wire.ReasonStorageFull, many, nil, "Your runner has no room left for these attachments. Try fewer or smaller files.", none},
+ {"unknown", "superseded", one, nil, "The coordinator could not answer this message.", retry},
+ {"unknown batch", "failed", many, nil, "The coordinator could not answer these messages.", retry},
+ } {
+ t.Run(c.name, func(t *testing.T) {
+ n := endedNote(wire.Turn{ID: "t_1", State: wire.TurnFailed, Reason: c.reason, MessageIDs: c.ids}, c.acct, now)
+ if n.ID != "t_1" || n.Line != c.line {
+ t.Fatalf("line %q, want %q", n.Line, c.line)
+ }
+ action := n.SignIn
+ if n.Retry {
+ if action != "" {
+ t.Fatal("two actions")
+ }
+ action = retry
+ }
+ if action != c.action {
+ t.Fatalf("action %q, want %q", action, c.action)
+ }
+ })
+ }
+ // A stopped turn says so, with nothing to do.
+ if n := endedNote(wire.Turn{ID: "t_2", State: wire.TurnCancelled, Reason: "cancelled", MessageIDs: one}, nil, now); n.Line != "Stopped." || n.Retry || n.SignIn != "" {
+ t.Fatalf("stopped %+v", n)
+ }
+ if copyText("chat.failed.retry") != "Try again" {
+ t.Fatal("Try again")
+ }
+}
diff --git a/internal/equipo/chat_page.go b/internal/equipo/chat_page.go
index 7f4e8630..f7a61b9b 100644
--- a/internal/equipo/chat_page.go
+++ b/internal/equipo/chat_page.go
@@ -311,8 +311,6 @@ func cardView(c wire.Card, choices []string, tasks map[string]wire.Task) chatCar
return v
}
-type chatEnded struct{ ID, Key string }
-
// sessionContext carries the browser session as the principal the chat
// store re-checks inside each transaction.
func sessionContext(r *http.Request) (context.Context, string, bool) {
@@ -423,6 +421,12 @@ func (a *application) chatPage(w http.ResponseWriter, r *http.Request) {
queuedTurns := map[string]bool{}
var latest *wire.Turn
for i, t := range snap.Turns {
+ // The person's latest turn, whatever state it is in: one that ended
+ // unanswered has the note; one waiting or queued has none above it.
+ // Turns the coordinator takes on its own never end in a note.
+ if t.Kind == wire.TurnPerson && (latest == nil || t.CreatedAt.After(latest.CreatedAt)) {
+ latest = &snap.Turns[i]
+ }
if !wire.Terminal(t.State) {
if held && (t.State == wire.TurnWaiting && t.Reason == wire.ReasonNoConnection || t.State == wire.TurnQueued) {
waitingTurns[t.ID] = true
@@ -442,10 +446,6 @@ func (a *application) chatPage(w http.ResponseWriter, r *http.Request) {
}
view.Waiting = append(view.Waiting, t)
}
- // Turns the coordinator takes on its own never end in a note.
- if t.Kind == wire.TurnPerson && (latest == nil || t.CreatedAt.After(latest.CreatedAt)) {
- latest = &snap.Turns[i]
- }
}
for i := range view.Messages {
if view.Messages[i].Own && waitingTurns[view.Messages[i].TurnID] {
@@ -460,17 +460,12 @@ func (a *application) chatPage(w http.ResponseWriter, r *http.Request) {
}
}
// A turn that ended unanswered on an earlier day is history there.
+ // Its note says why, and offers what to do (chat_failed.go).
if latest != nil && !latest.CreatedAt.Before(today) && (latest.State == wire.TurnFailed || latest.State == wire.TurnCancelled) {
- key := "chat." + latest.State
- switch {
- case latest.Reason == wire.ReasonStorageFull:
- // The runner had no room for an attachment: said in words.
- key = "chat.failed_storage"
- case latest.State == wire.TurnFailed && len(latest.MessageIDs) > 1:
- // The turn carried a batch: messages sent while another ran.
- key = "chat.failed_many"
- }
- view.Ended = &chatEnded{ID: latest.ID, Key: key}
+ if view.Ended, err = a.endedFor(ctx, address, *latest); err != nil {
+ a.failure(w, r, chatError(err))
+ return
+ }
}
if err := a.presentRoster(ctx, address, &view); err != nil {
a.failure(w, r, chatError(err))
diff --git a/internal/equipo/copy.go b/internal/equipo/copy.go
index baea8069..4f76aad6 100644
--- a/internal/equipo/copy.go
+++ b/internal/equipo/copy.go
@@ -814,6 +814,19 @@ var pageCopy = map[string]string{
"chat.offline": "Your runner is offline. Messages wait here until it is back.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
"chat.failed": "The coordinator could not answer this message.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
"chat.failed_many": "The coordinator could not answer these messages.", // COPY ACCEPTED BY DELEGATION (Astra, 2026-11-11)
+ "chat.failed.turn_timeout": "The reply ran out of time on your runner. Try again, or ask for less at once.", // COPY APPROVED (Paul, 2026-11-22, copy-review ipgtz3lqoo3rj6rpiodpekh6vu, unchanged)
+ "chat.failed.runner_restarted": "Your runner stopped before it could reply. Try again.", // COPY APPROVED (Paul, 2026-11-22, copy-review ipgtz3lqoo3rj6rpiodpekh6vu, unchanged)
+ "chat.failed.provider_failed": "{account} stopped before finishing the reply. Try again.", // COPY APPROVED (Paul, 2026-11-22, copy-review ipgtz3lqoo3rj6rpiodpekh6vu, unchanged)
+ "chat.failed.account_unavailable": "Your runner could not open {account} for this reply. Try again.", // COPY APPROVED (Paul, 2026-11-22, copy-review ipgtz3lqoo3rj6rpiodpekh6vu, unchanged)
+ "chat.failed.sign_in_again": "{account} needs you to sign in again.", // COPY APPROVED (Paul, 2026-11-22, copy-review ipgtz3lqoo3rj6rpiodpekh6vu, unchanged)
+ "chat.failed.limited": "{account} reached its usage limit. Try again once it resets, or add another account.", // COPY APPROVED (Paul, 2026-11-22, copy-review ipgtz3lqoo3rj6rpiodpekh6vu, unchanged)
+ "chat.failed.policy_rejected": "A safety check on your runner stopped this reply. Try again, and if it keeps happening, update your runner.", // COPY APPROVED (Paul, 2026-11-22, copy-review ipgtz3lqoo3rj6rpiodpekh6vu, unchanged)
+ "chat.failed.provider_rejected": "{account} could not work with the message as sent. Try again, or send it without attachments.", // COPY APPROVED (Paul, 2026-11-22, copy-review ipgtz3lqoo3rj6rpiodpekh6vu, unchanged)
+ "chat.failed.attachment_unavailable": "A file did not arrive whole on your runner. Attach it again.", // COPY APPROVED (Paul, 2026-11-22, copy-review ipgtz3lqoo3rj6rpiodpekh6vu, unchanged)
+ "chat.failed.runner_too_old": "Your runner is too old for this conversation. Update it, then try again.", // COPY APPROVED (Paul, 2026-11-22, copy-review ipgtz3lqoo3rj6rpiodpekh6vu, unchanged)
+ "chat.failed.the_model": "The model", // COPY APPROVED (Paul, 2026-11-22, copy-review ipgtz3lqoo3rj6rpiodpekh6vu, unchanged)
+ "chat.failed.an_account": "an account", // COPY APPROVED (Paul, 2026-11-22, copy-review ipgtz3lqoo3rj6rpiodpekh6vu, unchanged)
+ "chat.failed.retry": "Try again", // COPY APPROVED (Paul, 2026-11-22, copy-review ipgtz3lqoo3rj6rpiodpekh6vu, unchanged)
"chat.cancelled": "Stopped.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
"chat.activity.read_task_subject": "Checking ‘%s’…", // COPY ACCEPTED BY DELEGATION (Astra, 2026-11-13)
"chat.activity.cancel_task_subject": "Cancelling ‘%s’…", // COPY ACCEPTED BY DELEGATION (Astra, 2026-11-13)
diff --git a/internal/equipo/migrations/0099_turn_retry.sql b/internal/equipo/migrations/0099_turn_retry.sql
new file mode 100644
index 00000000..0ec7edd3
--- /dev/null
+++ b/internal/equipo/migrations/0099_turn_retry.sql
@@ -0,0 +1,3 @@
+-- A turn that tries a failed turn again (Try again) names it. The failed
+-- turn's messages moved to it; nothing reads this to dispatch.
+ALTER TABLE chat_turns ADD COLUMN retry_of text;
diff --git a/internal/equipo/migrations/schema.sql b/internal/equipo/migrations/schema.sql
index 14961402..812a8d5d 100644
--- a/internal/equipo/migrations/schema.sql
+++ b/internal/equipo/migrations/schema.sql
@@ -753,3 +753,5 @@ CREATE TABLE push_holds (id text PRIMARY KEY, until datetime);
ALTER TABLE person_devices ADD COLUMN native_session_hash text;
CREATE INDEX person_device_native_session ON person_devices(native_session_hash);
+
+ALTER TABLE chat_turns ADD COLUMN retry_of text;
diff --git a/internal/equipo/static/chat-stream.js b/internal/equipo/static/chat-stream.js
index a7e9f0df..90c7ca47 100644
--- a/internal/equipo/static/chat-stream.js
+++ b/internal/equipo/static/chat-stream.js
@@ -1012,6 +1012,11 @@
scroll();
} else if (type === "turn") {
revs[v.id] = Math.max(revs[v.id] || 0, v.revision || 0);
+ // A turn of the person's going (a message, or Try again): the note
+ // under the one that ended unanswered, and its action, are history.
+ if (!v.kind && (v.state === "queued" || v.state === "running" || v.state === "waiting")) {
+ feed.querySelectorAll("[data-ended]").forEach(function (note) { if (note.dataset.ended !== v.id) note.remove(); });
+ }
var heldNow = !!feed.querySelector("[data-no-connection]");
if (v.state === "waiting" && v.reason === "no_connection" || v.state === "queued" && heldNow) {
// Nothing can answer yet: no thinking line, no timer; the quiet
@@ -1074,6 +1079,8 @@
note.querySelector("p").textContent = v.state !== "failed" ? form.dataset.cancelled : v.reason === "runner_storage_full" && form.dataset.failedStorage ? form.dataset.failedStorage : (v.message_ids || []).length > 1 && form.dataset.failedMany ? form.dataset.failedMany : form.dataset.failed;
feed.append(note);
scroll();
+ // Why it failed, the account, and Try again are the server's.
+ if (v.state === "failed") refreshSoon();
}
} else if (type === "activity") {
showActivity(v);
diff --git a/internal/equipo/static/equipo.css b/internal/equipo/static/equipo.css
index 3a897049..753b08a4 100644
--- a/internal/equipo/static/equipo.css
+++ b/internal/equipo/static/equipo.css
@@ -173,6 +173,10 @@ html:has([equipo-conversation]) { overflow: hidden; scrollbar-gutter: auto; }
[equipo-system-note] [equipo-bubble] { background: transparent; color: var(--rst-text-muted); font-size: var(--rst-fs-sm); }
[equipo-system-note][equipo-card] { border: 0; background: transparent; color: var(--rst-text-muted); font-size: var(--rst-fs-sm); }
+/* The note under a reply that never came: why, then the one thing to do. */
+[equipo-system-note][data-ended] { display: flex; flex-wrap: wrap; align-items: center; gap: var(--rst-sp-2); }
+[equipo-system-note][data-ended] > p { margin: 0; }
+form[equipo-ended-action] { display: flex; flex-wrap: wrap; align-items: center; gap: var(--rst-sp-2); margin: 0; }
[equipo-send-status] { display: block; color: var(--rst-text-muted); font-size: var(--rst-fs-sm); }
[equipo-send-status]:empty { display: none; }
diff --git a/internal/equipo/templates/chat.html b/internal/equipo/templates/chat.html
index d83e99cd..2ef463f4 100644
--- a/internal/equipo/templates/chat.html
+++ b/internal/equipo/templates/chat.html
@@ -86,7 +86,7 @@
{{if not (or .Chat.Days .Chat.Open .Chat.Messages)}}{{template "chat-welcome" .}}{{end}}
{{range .Chat.Waiting}}<li equipo-message="incoming" equipo-thinking data-turn="{{.ID}}"{{with .Kind}} data-kind="{{.}}"{{end}} data-started="{{.CreatedAt.UnixMilli}}" aria-busy="true"><div equipo-message-meta><strong><span equipo-coordinator-mark>{{template "roster-mark" .}}</span><span equipo-visually-hidden>{{copy "conversation.coordinator"}}</span></strong><time></time></div><div equipo-bubble><div equipo-message-body equipo-markdown data-stream-text></div><p equipo-activity-line><span equipo-activity>{{if eq .Kind "move_in"}}{{copy "chat.moving_in"}}{{else if eq .Kind "explore"}}{{copy "chat.exploring"}}{{else}}{{copy "chat.activity.thinking"}}{{end}}</span><span equipo-activity-sep aria-hidden="true">·</span><span equipo-elapsed></span></p><form method="post" action="/conversation/turns/{{.ID}}/stop" data-card-form equipo-turn-stop>{{with $.Chat.Job}}<input type="hidden" name="from" value="job"><input type="hidden" name="job" value="{{.ID}}">{{end}}<button rst-btn data-quiet type="submit" data-turn-stop data-busy-label="{{copy "roster.stopping"}}">{{copy "roster.stop"}}</button></form></div></li>{{end}}
{{with .Chat.NoConnection}}<li equipo-card="no_connection" data-no-connection="{{.TurnID}}"><p equipo-card-line>{{.Line}}</p><p equipo-actions><a rst-btn="primary" href="/conversation/settings/connections/add" data-add-connection>{{copy "chat.no_connection.add"}}</a></p></li>{{end}}
-{{with .Chat.Ended}}<li equipo-system-note data-ended="{{.ID}}"><p>{{copy .Key}}</p></li>{{end}}
+{{with .Chat.Ended}}<li equipo-system-note data-ended="{{.ID}}"><p>{{.Line}}</p>{{if .Retry}}<form method="post" action="/conversation/turns/{{.ID}}/retry" data-card-form equipo-ended-action><button rst-btn type="submit" data-retry-turn>{{copy "chat.failed.retry"}}</button></form>{{else if .SignIn}}<a rst-btn href="{{.SignIn}}" equipo-ended-action data-sign-in-again>{{copy "chat.connections.sign_in_again_action"}}</a>{{end}}</li>{{end}}
</ol>
</section>
</div>
diff --git a/internal/plan3test/plan3_release_test.go b/internal/plan3test/plan3_release_test.go
index 9a2a25b9..0fd95cea 100644
--- a/internal/plan3test/plan3_release_test.go
+++ b/internal/plan3test/plan3_release_test.go
@@ -179,6 +179,8 @@ func plan3CopyInventory(t *testing.T) {
approvedJobs := strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY APPROVED (Paul, 2026-11-14, copy-review cvaxhn3pwgpxhpssj5cgizqtrq, unchanged)") || strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY APPROVED (Paul, 2026-11-14, copy-review cvaxhn3pwgpxhpssj5cgizqtrq)") || strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY APPROVED (Paul, 2026-11-14, copy-review mbvzxmewxxgud4ksakdb2m7pye)")
// Paul's own review of the Oficina connection's strings and API sentence.
approvedOficina := strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY APPROVED (Paul, 2026-11-16, copy-review arfnqquz6wks4vdyxptv6ditju, unchanged)")
+ // Paul's own review of the failed-reply lines and Try again.
+ approvedFailedReplies := strings.HasPrefix(key, "chat.failed.") && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY APPROVED (Paul, 2026-11-22, copy-review ipgtz3lqoo3rj6rpiodpekh6vu, unchanged)")
acceptedRoster := strings.HasPrefix(key, "roster.") && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY ACCEPTED BY DELEGATION (Astra, 2026-11-14)")
acceptedPlacement := strings.HasPrefix(key, "placement.") && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY ACCEPTED BY DELEGATION (Astra, 2026-11-15)")
acceptedAccess := slices.Contains([]string{"access.waiting", "access.reopen", "access.not_owned", "access.already", "access.unconfirmed", "access.missing", "access.uncheckable", "access.authority", "access.confirm_namespace", "access.namespace", "access.granted_note", "access.title", "access.confirm", "access.ask", "access.approve", "access.aside", "access.reason", "access.role", "access.confirmation", "access.filing", "access.pending", "access.approved", "access.declined", "access.expired", "access.limited", "access.failed", "access.operator", "access.continue"}, key) && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY ACCEPTED BY DELEGATION (Astra, 2026-11-17)")
@@ -193,7 +195,7 @@ func plan3CopyInventory(t *testing.T) {
// Paul, 2026-11-20: Luna's verdicts are the agent-access copy review.
acceptedAgentAccess := slices.Contains([]string{"copyAgentConfig", "copyAgentForbidden", "copyAgentNotFound", "copyAgentUnavailable", "copyAgentTooLarge", "copyAgentInvalid", "copyAgentMedia", "copyAgentUnauthenticated", "agent.equipo_projects_list", "agent.equipo_tasks_list", "agent.equipo_task_get", "agent.equipo_needs_you", "docs/api/equipo-v1.md / Delegated read-only operations"}, key) && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY ACCEPTED BY DELEGATION (Luna, 2026-11-20)")
acceptedCopy := strings.TrimSuffix(cells[3], " |") == "COPY ACCEPTED BY DELEGATION (Copy, record-bound) sha256:"+copydesk.Hash(rows[key])
- if !acceptedInjection && !acceptedMail && !acceptedPush && !acceptedAgentAccess && !acceptedAccess && !acceptedPlacementEdges && !acceptedPlacement && !acceptedReportActions && !acceptedRoster && !acceptedCopy && !strings.Contains(cells[3], "COPY REVIEW REQUIRED") && !acceptedAll && !acceptedGuide && !acceptedRound2 && !acceptedStarter && !acceptedDelegation && !approvedPublish && !approvedAssistant && !approvedJobs && !approvedOficina {
+ if !acceptedInjection && !acceptedMail && !acceptedPush && !acceptedAgentAccess && !acceptedAccess && !acceptedPlacementEdges && !acceptedPlacement && !acceptedReportActions && !acceptedRoster && !acceptedCopy && !strings.Contains(cells[3], "COPY REVIEW REQUIRED") && !acceptedAll && !acceptedGuide && !acceptedRound2 && !acceptedStarter && !acceptedDelegation && !approvedPublish && !approvedAssistant && !approvedJobs && !approvedOficina && !approvedFailedReplies {
t.Fatal("entry has no copy review status or applicable acceptance", key)
}
}
diff --git a/internal/thintest/batching_contract_test.go b/internal/thintest/batching_contract_test.go
index 3d6849fd..1be52125 100644
--- a/internal/thintest/batching_contract_test.go
+++ b/internal/thintest/batching_contract_test.go
@@ -422,7 +422,8 @@ func TestBatchSplitsToFitTheFrame(t *testing.T) {
}
// A failed batch says the coordinator could not answer these messages; a
-// failed turn of one message still says this message.
+// failed turn of one message still says this message. (A reason with
+// words of its own says those: chat_failed.go.)
func TestBatchFailedSaysThemAll(t *testing.T) {
r := newRig(t)
runner := r.dial(0)
@@ -431,7 +432,7 @@ func TestBatchFailedSaysThemAll(t *testing.T) {
runner.Send(r.ctx, "rep", wire.FrameReply, wire.Reply{TurnID: busy.Turn.ID, Attempt: 1, Text: "first"})
f := r.batchFrame(runner, batch, "alpha", "bravo", "charlie")
runner.Send(r.ctx, "ab", wire.FrameAck, wire.Ack{ID: f.ID})
- runner.Send(r.ctx, "fb", wire.FrameTurn, wire.TurnReport{TurnID: batch, Attempt: 1, State: wire.TurnFailed, Reason: "provider_failed"})
+ runner.Send(r.ctx, "fb", wire.FrameTurn, wire.TurnReport{TurnID: batch, Attempt: 1, State: wire.TurnFailed, Reason: ""})
r.turnIs(batch, wire.TurnFailed)
if page := r.inst.Get(t, "/conversation"); !strings.Contains(page, `data-ended="`+batch+`"><p>The coordinator could not answer these messages.</p>`) {
t.Fatal("a failed batch lacks the note for its messages")
@@ -442,7 +443,7 @@ func TestBatchFailedSaysThemAll(t *testing.T) {
}
of, _, _ := runner.Expect(r.ctx, wire.FrameMessage)
runner.Send(r.ctx, "a1", wire.FrameAck, wire.Ack{ID: of.ID})
- runner.Send(r.ctx, "f1", wire.FrameTurn, wire.TurnReport{TurnID: one.Turn.ID, Attempt: 1, State: wire.TurnFailed, Reason: "provider_failed"})
+ runner.Send(r.ctx, "f1", wire.FrameTurn, wire.TurnReport{TurnID: one.Turn.ID, Attempt: 1, State: wire.TurnFailed, Reason: ""})
r.turnIs(one.Turn.ID, wire.TurnFailed)
if page := r.inst.Get(t, "/conversation"); !strings.Contains(page, `data-ended="`+one.Turn.ID+`"><p>The coordinator could not answer this message.</p>`) {
t.Fatal("a failed single message lacks its note")
diff --git a/internal/thintest/client.go b/internal/thintest/client.go
index e2113758..eda80e77 100644
--- a/internal/thintest/client.go
+++ b/internal/thintest/client.go
@@ -135,6 +135,11 @@ func (c *Client) Cancel(ctx context.Context, id string) (out wire.CancelAccepted
return out, c.do(ctx, "POST", "/api/v1/turns/"+id+"/cancel", struct{}{}, &out)
}
+// Retry is POST /api/v1/turns/{id}/retry (Try again).
+func (c *Client) Retry(ctx context.Context, id string) (out wire.Turn, err error) {
+ return out, c.do(ctx, "POST", "/api/v1/turns/"+id+"/retry", nil, &out)
+}
+
func (c *Client) Messages(ctx context.Context, before string, limit int) (out wire.MessagePage, err error) {
path := "/api/v1/messages?limit=" + strconv.Itoa(limit)
if before != "" {
diff --git a/internal/thintest/instant_browser_test.go b/internal/thintest/instant_browser_test.go
index 88ad81f8..7c33126f 100644
--- a/internal/thintest/instant_browser_test.go
+++ b/internal/thintest/instant_browser_test.go
@@ -241,10 +241,11 @@ func TestBrowserInstantThinkingQueued(t *testing.T) {
// The first replies: the queued turn's line comes, the note goes.
runner.Send(r.ctx, "r-q1", wire.FrameReply, wire.Reply{TurnID: first, Attempt: 1, Text: "First done."})
p.wait(`document.querySelectorAll('[equipo-thinking]').length===1 && document.querySelector('[equipo-thinking]').dataset.turn===`+jsString(second)+` && !document.querySelector('[data-queued]')`, "the second turn's line, no note")
- // The batch of two fails: its note says these messages, from the event.
+ // The batch of two fails for no reason given: its note says these
+ // messages, from the event and then the server.
bf := messageFrame(t, r, runner)
runner.Send(r.ctx, "a-q2", wire.FrameAck, wire.Ack{ID: bf.ID})
- runner.Send(r.ctx, "f-q2", wire.FrameTurn, wire.TurnReport{TurnID: second, Attempt: 1, State: wire.TurnFailed, Reason: "provider_failed"})
+ runner.Send(r.ctx, "f-q2", wire.FrameTurn, wire.TurnReport{TurnID: second, Attempt: 1, State: wire.TurnFailed, Reason: ""})
p.wait(`(document.querySelector('[data-ended=`+jsString(second)+`] p')||{}).textContent===`+jsString("The coordinator could not answer these messages."), "the failed batch's note")
p.stayed("queued sends")
}
diff --git a/internal/thintest/retry_authority_contract_test.go b/internal/thintest/retry_authority_contract_test.go
new file mode 100644
index 00000000..02df6f63
--- /dev/null
+++ b/internal/thintest/retry_authority_contract_test.go
@@ -0,0 +1,335 @@
+package thintest
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+ "strings"
+ "sync"
+ "testing"
+ "time"
+
+ "amadan.net/oficina/equipo/internal/equipo"
+ "amadan.net/oficina/equipo/internal/wire"
+)
+
+// What a turn was allowed, asked and given goes with it to its retry
+// (chat.Retry): the project the person chose, a question still waiting on
+// them, the words that ask for access, and what was already asked.
+
+// retried fails the tool rig's turn, tries it again, and makes the retry
+// the turn its calls belong to, at its attempt.
+func (r *toolRig) retried(reason string) *wire.MessageCommand {
+ r.t.Helper()
+ failed := r.turn
+ r.failOn(r.runner, failed, reason, "")
+ if _, err := r.client.Retry(r.ctx, failed); err != nil {
+ r.t.Fatal(err)
+ }
+ _, body := r.expect(wire.FrameMessage)
+ cmd := body.(*wire.MessageCommand)
+ r.turn, r.attempt = cmd.TurnID, cmd.Attempt
+ r.turnIs(cmd.TurnID, wire.TurnRunning)
+ return cmd
+}
+
+// A placement answer's turn that failed and is tried again keeps the
+// project the person chose: no other repository is created or recorded.
+func TestContractRetryKeepsChosenProject(t *testing.T) {
+ r := newToolRigSaying(t, wire.ProtocolCurrent, "Make a calendar")
+ if res := r.call("placement-q", wire.ToolAskPerson, map[string]any{"question": "Where?", "placement": wire.Placement{Repos: []string{"oficina/sample"}, NewRepo: "oficina/calendar"}}); res.Code != "asked" {
+ t.Fatal(res)
+ }
+ if err := r.runner.Send(r.ctx, "finish-ask", wire.FrameReply, wire.Reply{TurnID: r.turn, Attempt: 1, Text: "Where should it go?"}); err != nil {
+ t.Fatal(err)
+ }
+ r.turnIs(r.turn, wire.TurnReplied)
+ snap, _ := r.client.Snapshot(r.ctx)
+ var card wire.Card
+ for _, c := range snap.Cards {
+ if c.Kind == wire.CardQuestion {
+ card = c
+ }
+ }
+ if _, err := r.client.Answer(r.ctx, card.ID, "New project: oficina/calendar", card.Revision); err != nil {
+ t.Fatal(err)
+ }
+ _, body := r.expect(wire.FrameMessage)
+ r.turn = body.(*wire.MessageCommand).TurnID
+ r.turnIs(r.turn, wire.TurnRunning)
+ if cmd := r.retried("provider_failed"); !strings.Contains(cmd.Text, "Make a calendar") {
+ t.Fatalf("the retried answer lost the original request %q", cmd.Text)
+ }
+ if got := r.call("wrong-create", wire.ToolCreateProject, map[string]string{"repo": "amadan.net/oficina/other"}); !got.IsError {
+ t.Fatal("a retry created another repository", got)
+ }
+ if got := r.call("wrong-record", wire.ToolRecordTask, map[string]string{"repo": "oficina/sample", "title": "Misfiled calendar", "brief": "Make the calendar"}); !got.IsError || got.Code != "placement_mismatch" {
+ t.Fatal("a retry recorded outside the chosen project", got)
+ }
+ if got := r.call("right-create", wire.ToolCreateProject, map[string]string{"repo": "amadan.net/oficina/calendar"}); got.Code != "create" {
+ t.Fatal("the chosen project", got)
+ }
+ if _, err := r.client.Answer(r.ctx, card.ID, "Add to oficina/sample", card.Revision); err == nil {
+ t.Fatal("the answered card took another answer")
+ }
+}
+
+// A placement question the failed turn asked still waits on the person in
+// its retry: nothing is recorded before they choose.
+func TestContractRetryKeepsPendingChoice(t *testing.T) {
+ r := newToolRigSaying(t, wire.ProtocolCurrent, "Make a calendar")
+ if res := r.call("placement-q", wire.ToolAskPerson, map[string]any{"question": "Where?", "placement": wire.Placement{Repos: []string{"oficina/sample"}, NewRepo: "oficina/calendar"}}); res.Code != "asked" {
+ t.Fatal(res)
+ }
+ r.retried("turn_timeout")
+ if got := r.call("record-early", wire.ToolRecordTask, map[string]string{"repo": "oficina/sample", "title": "Calendar", "brief": "Make the calendar"}); !got.IsError || got.Code != "placement_pending" {
+ t.Fatal("a retry recorded before the person chose", got)
+ }
+ if got := r.call("create-early", wire.ToolCreateProject, map[string]string{"repo": "amadan.net/oficina/calendar"}); !got.IsError {
+ t.Fatal("a retry created before the person chose", got)
+ }
+}
+
+// The person's words that ask for access are the retry's too; an access
+// card the failed turn raised is the retry's, and not raised again.
+func TestContractRetryKeepsAccessRequest(t *testing.T) {
+ const reason = "I need access to fix the build."
+ t.Run("provenance", func(t *testing.T) {
+ r := newToolRigSaying(t, wire.ProtocolCurrent, "Please get access to the whole carlos namespace")
+ r.retried("provider_failed")
+ if got := r.call("access", wire.ToolRequestAccess, map[string]any{"target": "carlos", "reason": reason}); got.Code != "asked" {
+ t.Fatal("the retry lost the person's request", got)
+ }
+ })
+ t.Run("spent", func(t *testing.T) {
+ r := newToolRigSaying(t, wire.ProtocolCurrent, "Please get access to carlos/platform")
+ if got := r.call("access", wire.ToolRequestAccess, map[string]any{"target": "carlos/platform", "reason": reason}); got.Code != "asked" {
+ t.Fatal(got)
+ }
+ r.retried("provider_failed")
+ // The failed attempt asked: the retry, its next attempt, is answered
+ // from that (the ledger), with no second card, whatever it asks.
+ for i, why := range []string{reason, "Another reason to ask again."} {
+ if got := r.call("access-again-"+itoa(i), wire.ToolRequestAccess, map[string]any{"target": "carlos/platform", "reason": why}); got.Code != "asked" && got.Code != "already_asked" {
+ t.Fatal(got)
+ }
+ }
+ if all, mine := r.count("SELECT count(*) FROM chat_cards WHERE kind = ?", wire.CardAccess), r.count("SELECT count(*) FROM chat_cards WHERE kind = ? AND turn_id = ?", wire.CardAccess, r.turn); all != 1 || mine != 1 {
+ t.Fatalf("%d access cards, %d on the retry", all, mine)
+ }
+ })
+}
+
+// Try again from several places at once: one retry, one frame.
+func TestContractRetryConcurrent(t *testing.T) {
+ r, runner := retryRig(t, nil)
+ failed := r.say(runner, "Again, please", "k1").TurnID
+ r.failOn(runner, failed, "turn_timeout", "")
+ var wg sync.WaitGroup
+ ids := make(chan string, 8)
+ codes := make(chan int, 8)
+ for i := range 8 {
+ wg.Add(1)
+ go func() {
+ defer wg.Done()
+ if i%2 == 0 {
+ v, err := r.client.Retry(r.ctx, failed)
+ if err != nil {
+ codes <- Status(err)
+ return
+ }
+ ids <- v.ID
+ return
+ }
+ req, _ := http.NewRequest("POST", r.inst.URL+"/conversation/turns/"+failed+"/retry", strings.NewReader(url.Values{}.Encode()))
+ req.AddCookie(r.inst.Cookie())
+ req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
+ req.Header.Set("Origin", r.inst.URL)
+ req.Header.Set("Sec-Fetch-Site", "same-origin")
+ res, err := (&http.Client{CheckRedirect: func(*http.Request, []*http.Request) error { return http.ErrUseLastResponse }}).Do(req)
+ if err != nil {
+ codes <- 0
+ return
+ }
+ res.Body.Close()
+ if res.StatusCode != http.StatusSeeOther {
+ codes <- res.StatusCode
+ }
+ }()
+ }
+ wg.Wait()
+ close(ids)
+ close(codes)
+ for code := range codes {
+ t.Errorf("a concurrent Try again answered %d", code)
+ }
+ var first string
+ for id := range ids {
+ if first == "" {
+ first = id
+ }
+ if id != first {
+ t.Fatalf("two retries: %s and %s", first, id)
+ }
+ }
+ if n := r.count("SELECT count(*) FROM chat_turns WHERE retry_of = ?", failed); n != 1 {
+ t.Fatalf("%d retries queued", n)
+ }
+ if cmd := r.running(runner); cmd.TurnID != first {
+ t.Fatalf("the frame is for %s, not %s", cmd.TurnID, first)
+ }
+ if n := r.count("SELECT count(*) FROM runner_commands WHERE kind = ?", wire.FrameMessage); n != 2 {
+ t.Fatalf("%d message commands, want the first and one retry", n)
+ }
+}
+
+// A failed turn's note goes once a newer turn of the person's waits: for
+// a connection, or behind a turn the coordinator took on its own.
+func TestContractEndedNoteGoesWhileWaiting(t *testing.T) {
+ t.Run("no connection", func(t *testing.T) {
+ r, runner := retryRig(t, nil)
+ failed := r.say(runner, "First", "k1").TurnID
+ r.failOn(runner, failed, "turn_timeout", "")
+ waiting := r.say(runner, "Second", "k2").TurnID
+ runner.Send(r.ctx, "w-"+waiting, wire.FrameTurn, wire.TurnReport{TurnID: waiting, Attempt: 1, State: wire.TurnWaiting, Reason: wire.ReasonNoConnection})
+ r.turnIs(waiting, wire.TurnWaiting)
+ if page := r.inst.Get(t, "/conversation"); strings.Contains(page, `data-ended="`+failed) || !strings.Contains(page, `data-no-connection="`+waiting) {
+ t.Fatal("the failed turn's note came back while the next waits for a connection")
+ }
+ })
+ t.Run("queued behind", func(t *testing.T) {
+ r := newMoveInRig(t)
+ if _, err := r.client.Send(r.ctx, "First", "k1"); err != nil {
+ t.Fatal(err)
+ }
+ failed := r.dispatched(wire.TurnPerson).TurnID
+ r.failOn(r.runner, failed, "turn_timeout", "")
+ r.moveIn("r-mi-1", wire.TurnMoveIn)
+ queued, err := r.client.Send(r.ctx, "Second", "k2")
+ if err != nil || queued.Turn.State != wire.TurnQueued {
+ t.Fatalf("%+v %v", queued.Turn, err)
+ }
+ if page := r.inst.Get(t, "/conversation"); strings.Contains(page, `data-ended="`+failed) {
+ t.Fatal("the failed turn's note came back while the next is queued behind a move-in")
+ }
+ })
+}
+
+// What the failed attempt did is not done again: the task it recorded is
+// the retry's, answered from the ledger, not a second task.
+func TestContractRetryDoesNotRedo(t *testing.T) {
+ r := newToolRigAt(t, wire.ProtocolCurrent)
+ args := map[string]string{"repo": "oficina/sample", "title": "Fix the compose sheet", "brief": "The compose sheet loses its draft."}
+ first := r.call("record", wire.ToolRecordTask, args)
+ if first.Code != "recorded" {
+ t.Fatal(first)
+ }
+ r.retried("provider_failed")
+ if again := r.call("record", wire.ToolRecordTask, args); again.Code != "recorded" || again.Text != first.Text {
+ t.Fatalf("the retry recorded %+v, not the failed attempt's %+v", again, first)
+ }
+ if n := r.count("SELECT count(*) FROM chat_tasks"); n != 1 {
+ t.Fatalf("%d tasks", n)
+ }
+ if n := r.count("SELECT count(*) FROM chat_tasks WHERE turn_id = ?", r.turn); n != 1 {
+ t.Fatal("the task is not the retry's")
+ }
+}
+
+// A repository creation the failed turn used stays used: the person's
+// words for a new project, now the retry's, grant no second repository.
+func TestContractRetryKeepsSpentCreation(t *testing.T) {
+ r := newToolRigSaying(t, wire.ProtocolCurrent, "Create a new project for the calendar")
+ if got := r.call("create-a", wire.ToolCreateProject, map[string]string{"repo": "amadan.net/oficina/calendar"}); got.Code != "create" {
+ t.Fatal("the person's words", got)
+ }
+ r.retried("provider_failed")
+ if got := r.call("create-b", wire.ToolCreateProject, map[string]string{"repo": "amadan.net/oficina/other"}); !got.IsError || got.Code != "placement_required" {
+ t.Fatal("a retry created a second repository", got)
+ }
+ if n := r.count("SELECT count(*) FROM chat_turns WHERE id = ? AND create_repo = ?", r.turn, "amadan.net/oficina/calendar"); n != 1 {
+ t.Fatal("the retry lost what was spent")
+ }
+}
+
+// Every member's live stream hears of a task the retry took over, at a
+// new revision naming the retry's turn.
+func TestContractRetryTellsEveryMember(t *testing.T) {
+ r := newToolRigAt(t, wire.ProtocolCurrent)
+ if got := r.call("record", wire.ToolRecordTask, map[string]string{"repo": "oficina/sample", "title": "Fix the compose sheet", "brief": "The compose sheet loses its draft."}); got.Code != "recorded" {
+ t.Fatal(got)
+ }
+ const member = "member@example.com"
+ if err := r.inst.Store.SetMember(context.Background(), equipo.Actor{Address: Owner}, member, equipo.RoleMember, true, 0); err != nil {
+ t.Fatal(err)
+ }
+ mate := NewClient(r.inst.URL, r.inst.DeviceTokenFor(t, member))
+ snap, err := mate.Snapshot(r.ctx)
+ if err != nil {
+ t.Fatal(err)
+ }
+ var before wire.Task
+ for _, k := range snap.Tasks {
+ before = k
+ }
+ if before.ID == "" {
+ t.Fatal("the member does not see the task")
+ }
+ view := NewConversation(snap)
+ s, err := mate.Open(r.ctx, snap.Cursor)
+ if err != nil {
+ t.Fatal(err)
+ }
+ t.Cleanup(s.Close)
+ go view.Follow(s)
+ cmd := r.retried("provider_failed")
+ if !view.Wait(10*time.Second, func(c *Conversation) bool {
+ k := c.Tasks[before.ID]
+ return k.Revision > before.Revision && k.TurnID == cmd.TurnID
+ }) {
+ t.Fatalf("the member's stream kept %+v", view.Tasks[before.ID].TurnID)
+ }
+ if k, err := mate.Task(r.ctx, before.ID); err != nil || k.TurnID != cmd.TurnID || k.Revision <= before.Revision || k.SourceMessageID == "" {
+ t.Fatalf("the member reads %+v %v", k, err)
+ }
+}
+
+// A reply in a card's thread that failed and is tried again stays in the
+// thread, and the card is told again at a new revision.
+func TestContractRetryKeepsThread(t *testing.T) {
+ r := newToolRigAt(t, wire.ProtocolCurrent)
+ if res := r.call("q", wire.ToolAskPerson, map[string]any{"question": "Which page?", "options": []string{"Login", "Home"}}); res.Code != "asked" {
+ t.Fatal(res)
+ }
+ r.runner.Send(r.ctx, "rep-q", wire.FrameReply, wire.Reply{TurnID: r.turn, Attempt: 1, Text: "Which page?"})
+ r.turnIs(r.turn, wire.TurnReplied)
+ var card wire.Card
+ r.wait("question card", func(c *Conversation) bool {
+ for _, k := range c.Cards {
+ if k.Kind == wire.CardQuestion {
+ card = k
+ }
+ }
+ return card.ID != ""
+ })
+ answered, err := r.client.Answer(r.ctx, card.ID, "Login", card.Revision)
+ if err != nil {
+ t.Fatal(err)
+ }
+ r.expect(wire.FrameMessage)
+ r.runner.Send(r.ctx, "rep-a", wire.FrameReply, wire.Reply{TurnID: answered.Turn.ID, Attempt: 1, Text: "Looking at login."})
+ r.turnIs(answered.Turn.ID, wire.TurnReplied)
+ if status, _ := r.post(r.inst.Cookie(), "/conversation/cards/"+card.ID+"/reply", url.Values{"request_id": {"k-thread"}, "body": {"Only on Safari"}}); status != http.StatusSeeOther {
+ t.Fatal("thread reply", status)
+ }
+ _, body := r.expect(wire.FrameMessage)
+ r.turn = body.(*wire.MessageCommand).TurnID
+ r.turnIs(r.turn, wire.TurnRunning)
+ var before int64
+ r.wait("the thread's card", func(c *Conversation) bool { before = c.Cards[card.ID].Revision; return before > 0 })
+ r.retried("provider_failed")
+ if n := r.count("SELECT count(*) FROM chat_card_threads WHERE card_id = ? AND turn_id = ?", card.ID, r.turn); n != 1 {
+ t.Fatal("the thread lost the retried reply")
+ }
+ r.wait("the card told again", func(c *Conversation) bool { return c.Cards[card.ID].Revision > before })
+}
diff --git a/internal/thintest/retry_browser_test.go b/internal/thintest/retry_browser_test.go
new file mode 100644
index 00000000..cf953eba
--- /dev/null
+++ b/internal/thintest/retry_browser_test.go
@@ -0,0 +1,74 @@
+//go:build browser
+
+package thintest
+
+import (
+ "strings"
+ "testing"
+
+ "amadan.net/oficina/equipo/internal/wire"
+)
+
+// TestBrowserTryAgain: a reply fails while the conversation is open. The
+// note comes from the event at once, then says why in the server's words,
+// with the account and Try again. Try again goes in place, with no
+// reload: the note and its button go, the thinking line comes, and the
+// runner has the same message again, sent once. Without scripts Try again
+// is a form post (TestContractRetryAnswersAgain). Tried again from
+// another device, the open page drops the note as the retry starts. Saved as
+// try-again-<width>.png when EQUIPO_BROWSER_ARTIFACTS names a directory.
+func TestBrowserTryAgain(t *testing.T) {
+ r, runner := retryRig(t, nil)
+ p := openInner(t, r.inst.URL, r.inst.Cookie(), 390, 844, true, "light", "no-preference")
+ defer p.stop()
+ p.open("/conversation")
+ p.wait(`document.querySelector('[data-chat-stream]')`, "the conversation")
+ const words = "Where is the login bug?"
+ failed := r.say(runner, words, "k1").TurnID
+ r.failOn(runner, failed, "provider_failed", "claude-a")
+ note := `document.querySelector('[data-ended=` + jsString(failed) + `]')`
+ p.wait(`(`+note+`?.querySelector('p')||{}).textContent===`+jsString("Claude (owner@example.com) stopped before finishing the reply. Try again.")+` && !!`+note+`.querySelector('button[data-retry-turn]')`, "the note's reason, account and Try again")
+ p.check(`(b=>b.textContent==='Try again' && b.getBoundingClientRect().height>0 && b.getBoundingClientRect().width>0)(`+note+`.querySelector('[data-retry-turn]'))`, "Try again is not visible")
+ p.fits("the failed reply's note")
+ p.shot("try-again-390")
+ p.click(`[data-retry-turn]`)
+ cmd := r.running(runner)
+ if cmd.TurnID == failed || strings.Join(cmd.PersonText, "|") != words {
+ t.Fatalf("Try again sent %s %q", cmd.TurnID, cmd.PersonText)
+ }
+ p.wait(`!document.querySelector('[data-ended]') && !document.querySelector('[data-retry-turn]') && !!document.querySelector('[equipo-thinking][data-turn=`+jsString(cmd.TurnID)+`]')`, "the note gone and the thinking line there")
+ p.check(`[...document.querySelectorAll('[equipo-message="own"] [equipo-message-body]')].filter(e=>e.textContent===`+jsString(words)+`).length===1`, "the message shows twice, or not at all")
+ p.stayed("Try again")
+ if n := r.count("SELECT count(*) FROM chat_turns WHERE retry_of = ?", failed); n != 1 {
+ t.Fatalf("%d retries queued", n)
+ }
+ // It fails again, and another device tries again: the open page
+ // follows, the note going as the retry starts.
+ r.failOn(runner, cmd.TurnID, "turn_timeout", "")
+ again := `document.querySelector('[data-ended=` + jsString(cmd.TurnID) + `] [data-retry-turn]')`
+ p.wait(again, "the failed retry's Try again")
+ if _, err := r.client.Retry(r.ctx, cmd.TurnID); err != nil {
+ t.Fatal(err)
+ }
+ p.wait(`!document.querySelector('[data-ended]')`, "the note gone when another device tried again")
+ p.stayed("another device's Try again")
+}
+
+// TestBrowserEndedNoteStaysGone: a reply fails, then the next message
+// waits for a connection. The note goes as that turn starts, and the
+// refresh that brings the connection card does not bring it back.
+func TestBrowserEndedNoteStaysGone(t *testing.T) {
+ r, runner := retryRig(t, nil)
+ p := openInner(t, r.inst.URL, r.inst.Cookie(), 390, 844, true, "light", "no-preference")
+ defer p.stop()
+ p.open("/conversation")
+ p.wait(`document.querySelector('[data-chat-stream]')`, "the conversation")
+ failed := r.say(runner, "First", "k1").TurnID
+ r.failOn(runner, failed, "turn_timeout", "")
+ p.wait(`document.querySelector('[data-ended=`+jsString(failed)+`] [data-retry-turn]')`, "the failed reply's note")
+ waiting := r.say(runner, "Second", "k2").TurnID
+ runner.Send(r.ctx, "w-"+waiting, wire.FrameTurn, wire.TurnReport{TurnID: waiting, Attempt: 1, State: wire.TurnWaiting, Reason: wire.ReasonNoConnection})
+ p.wait(`!!document.querySelector('[data-no-connection]') && !document.querySelector('[data-ended]')`, "the connection card, and no note")
+ p.check(`!document.querySelector('[data-ended]')`, "the note came back")
+ p.stayed("waiting for a connection")
+}
diff --git a/internal/thintest/retry_contract_test.go b/internal/thintest/retry_contract_test.go
new file mode 100644
index 00000000..85e7f8bd
--- /dev/null
+++ b/internal/thintest/retry_contract_test.go
@@ -0,0 +1,368 @@
+package thintest
+
+import (
+ "context"
+ "io"
+ "net/http"
+ "net/url"
+ "regexp"
+ "slices"
+ "strings"
+ "testing"
+ "time"
+
+ "amadan.net/oficina/equipo/internal/equipo"
+ "amadan.net/oficina/equipo/internal/wire"
+)
+
+// Try again (Paul, 2026-11-22): the note under a failed reply says why,
+// names the account it ran on, and offers Try again: a new turn takes
+// the failed turn's exchange over as its next attempt (chat.Retry). The
+// message is never sent twice, and its words never ride again as
+// unanswered.
+
+// retryRig is a rig whose runner is online with conns (toolHello's one
+// Claude connection, claude-a, labelled with the owner's email, when nil).
+func retryRig(t *testing.T, conns []wire.HeldConnection) (*rig, *FakeRunner) {
+ t.Helper()
+ r := newRig(t)
+ runner := r.dial(0)
+ hello := toolHello(runner.Welcome.Generation)
+ if conns != nil {
+ hello.Connections = conns
+ }
+ if err := runner.Send(r.ctx, "h1", wire.FrameHello, hello); err != nil {
+ t.Fatal(err)
+ }
+ r.wait("runner online", func(c *Conversation) bool { return c.Runner.Online })
+ return r, runner
+}
+
+// running is the next message frame, acked, once its turn runs.
+func (r *rig) running(runner *FakeRunner) *wire.MessageCommand {
+ r.t.Helper()
+ f, body, err := runner.Expect(r.ctx, wire.FrameMessage)
+ if err != nil {
+ r.t.Fatal(err)
+ }
+ runner.Send(r.ctx, "a-"+f.ID, wire.FrameAck, wire.Ack{ID: f.ID})
+ cmd := body.(*wire.MessageCommand)
+ r.turnIs(cmd.TurnID, wire.TurnRunning)
+ return cmd
+}
+
+// say sends text and returns its running turn's frame.
+func (r *rig) say(runner *FakeRunner, text, key string) *wire.MessageCommand {
+ r.t.Helper()
+ if _, err := r.client.Send(r.ctx, text, key); err != nil {
+ r.t.Fatal(err)
+ }
+ return r.running(runner)
+}
+
+// attempt is a turn's current attempt (a retry is its failed turn's next).
+func (r *rig) attempt(id string) int64 {
+ r.t.Helper()
+ v, err := r.client.Turn(r.ctx, id)
+ if err != nil {
+ r.t.Fatal(err)
+ }
+ return v.Attempt
+}
+
+// failOn fails a running turn for reason; local names the connection
+// its attempt ran on (a usage row, as a runner reports one), or none.
+func (r *rig) failOn(runner *FakeRunner, id, reason, local string) {
+ r.t.Helper()
+ attempt := r.attempt(id)
+ if local != "" {
+ runner.Send(r.ctx, "u-"+id, wire.FrameUsage, wire.UsageReport{TurnID: id, Rows: []wire.Usage{{Provider: wire.ProviderClaude, Connection: local, Model: "claude-sonnet", Attempt: attempt, Outcome: wire.OutcomeFailed}}})
+ }
+ runner.Send(r.ctx, "f-"+id, wire.FrameTurn, wire.TurnReport{TurnID: id, Attempt: attempt, State: wire.TurnFailed, Reason: reason})
+ r.turnIs(id, wire.TurnFailed)
+}
+
+// tryAgain posts the page's Try again as the owner's browser, from site.
+func (r *rig) tryAgain(id, site string) (int, string) {
+ r.t.Helper()
+ req, _ := http.NewRequest("POST", r.inst.URL+"/conversation/turns/"+id+"/retry", strings.NewReader(url.Values{}.Encode()))
+ req.AddCookie(r.inst.Cookie())
+ req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
+ origin := r.inst.URL
+ if site != "same-origin" {
+ origin = "https://foreign.example"
+ }
+ req.Header.Set("Origin", origin)
+ req.Header.Set("Sec-Fetch-Site", site)
+ res, err := (&http.Client{CheckRedirect: func(*http.Request, []*http.Request) error { return http.ErrUseLastResponse }}).Do(req)
+ if err != nil {
+ r.t.Fatal(err)
+ }
+ io.Copy(io.Discard, res.Body)
+ res.Body.Close()
+ return res.StatusCode, res.Header.Get("Location")
+}
+
+func (r *rig) count(query string, args ...any) int {
+ r.t.Helper()
+ var n int
+ if err := r.inst.DB.Writer().QueryRow(query, args...).Scan(&n); err != nil {
+ r.t.Fatal(err)
+ }
+ return n
+}
+
+func retryForm(id string) string {
+ return `<form method="post" action="/conversation/turns/` + id + `/retry"`
+}
+
+func TestContractRetryAnswersAgain(t *testing.T) {
+ r, runner := retryRig(t, nil)
+ const words = "Where is the login bug?"
+ failed := r.say(runner, words, "k1").TurnID
+ r.failOn(runner, failed, "provider_failed", "claude-a")
+ page := r.inst.Get(t, "/conversation")
+ if !strings.Contains(page, `data-ended="`+failed+`"><p>Claude (owner@example.com) stopped before finishing the reply. Try again.</p>`+retryForm(failed)) {
+ t.Fatal("the failed reply's note lacks its account or Try again")
+ }
+ // Production's policy refuses inline styles and scripts.
+ _, note, _ := strings.Cut(page, `data-ended="`+failed)
+ note, _, _ = strings.Cut(note, "</li>")
+ if inlineStyle.MatchString(note) || regexp.MustCompile(`(?i)\son[a-z]+=|<script|javascript:`).MatchString(note) {
+ t.Fatalf("the note is not CSP-clean: %s", note)
+ }
+ ids := r.turnIs(failed, wire.TurnFailed).MessageIDs
+ if status, at := r.tryAgain(failed, "same-origin"); status != http.StatusSeeOther || at != "/conversation" {
+ t.Fatalf("Try again: %d %s", status, at)
+ }
+ cmd := r.running(runner)
+ if cmd.TurnID == failed || cmd.Attempt != 2 || strings.Join(cmd.PersonText, "|") != words || cmd.Text != words {
+ t.Fatalf("the retry's frame %s %d %q %q", cmd.TurnID, cmd.Attempt, cmd.PersonText, cmd.Text)
+ }
+ for _, m := range cmd.Tail {
+ if m.Text == words {
+ t.Fatal("the retried words ride in the tail too")
+ }
+ }
+ retried := cmd.TurnID
+ // A double tap, and a device asking too: one turn.
+ if status, _ := r.tryAgain(failed, "same-origin"); status != http.StatusSeeOther {
+ t.Fatalf("second Try again: %d", status)
+ }
+ if again, err := r.client.Retry(r.ctx, failed); err != nil || again.ID != retried || !slices.Equal(again.MessageIDs, ids) {
+ t.Fatalf("the device's retry %+v %v", again, err)
+ }
+ // The failed turn keeps its reason, and its messages are the retry's.
+ if old := r.turnIs(failed, wire.TurnFailed); old.Reason != "provider_failed" || len(old.MessageIDs) != 0 {
+ t.Fatalf("the failed turn after Try again %+v", old)
+ }
+ if n := r.count("SELECT count(*) FROM chat_turns WHERE retry_of = ?", failed); n != 1 {
+ t.Fatalf("%d retries queued", n)
+ }
+ if n := r.count("SELECT count(*) FROM chat_messages WHERE text = ?", words); n != 1 {
+ t.Fatalf("the message is there %d times", n)
+ }
+ // The note and its action go once the retry runs; the message shows once.
+ page = r.inst.Get(t, "/conversation")
+ if strings.Contains(page, `data-ended="`+failed) || strings.Contains(page, "/retry") || strings.Count(page, words) != 1 || !strings.Contains(page, `data-turn="`+retried+`"`) {
+ t.Fatal("the page after Try again")
+ }
+ runner.Send(r.ctx, "rep", wire.FrameReply, wire.Reply{TurnID: retried, Attempt: cmd.Attempt, Text: "It is in the session check."})
+ r.turnIs(retried, wire.TurnReplied)
+ // Answered now: the words are in the transcript, carried no further.
+ next := r.say(runner, "Thanks", "k2")
+ if strings.Join(next.PersonText, "|") != "Thanks" || strings.Contains(next.Text, words) {
+ t.Fatalf("the answered words rode again %q %q", next.PersonText, next.Text)
+ }
+ var tail []string
+ for _, m := range next.Tail {
+ tail = append(tail, m.Text)
+ }
+ if strings.Join(tail, "|") != words+"|It is in the session check." {
+ t.Fatalf("the tail after the retry %q", tail)
+ }
+}
+
+// A retry that also fails before the model ran leaves the words
+// unanswered once: the next message carries them, once.
+func TestContractRetryFailedAgainCarriesOnce(t *testing.T) {
+ r, runner := retryRig(t, nil)
+ const words = "Please check the build"
+ failed := r.say(runner, words, "k1").TurnID
+ r.failOn(runner, failed, "policy_rejected", "")
+ retried, err := r.client.Retry(r.ctx, failed)
+ if err != nil || retried.State != wire.TurnQueued && retried.State != wire.TurnRunning {
+ t.Fatalf("retry %+v %v", retried, err)
+ }
+ if cmd := r.running(runner); cmd.TurnID != retried.ID || strings.Contains(cmd.Text, "Not yet answered") {
+ t.Fatalf("the retry carried its own words %q", cmd.Text)
+ }
+ r.failOn(runner, retried.ID, "turn_timeout", "")
+ // The retried turn is the latest: its note, and Try again again.
+ page := r.inst.Get(t, "/conversation")
+ if !strings.Contains(page, `data-ended="`+retried.ID+`"><p>The reply ran out of time on your runner. Try again, or ask for less at once.</p>`+retryForm(retried.ID)) {
+ t.Fatal("a failed retry's note")
+ }
+ if again, err := r.client.Retry(r.ctx, retried.ID); err != nil || again.ID == retried.ID {
+ t.Fatalf("retrying the retry %+v %v", again, err)
+ } else if cmd := r.running(runner); strings.Join(cmd.PersonText, "|") != words {
+ t.Fatalf("the second retry %q", cmd.PersonText)
+ } else {
+ r.failOn(runner, cmd.TurnID, "policy_rejected", "")
+ }
+ next := r.say(runner, "Any news?", "k2")
+ if strings.Join(next.PersonText, "|") != words+"|Any news?" || strings.Count(next.Text, words) != 1 {
+ t.Fatalf("the unanswered words %q %q", next.PersonText, next.Text)
+ }
+}
+
+// Only the latest failed turn can be tried again, while nothing of the
+// person's runs, and only by them; a reason another try cannot mend has
+// no Try again.
+func TestContractRetryRefused(t *testing.T) {
+ r, runner := retryRig(t, nil)
+ first := r.say(runner, "One", "k1").TurnID
+ r.failOn(runner, first, "provider_failed", "")
+ second := r.say(runner, "Two", "k2").TurnID
+ r.failOn(runner, second, "superseded", "")
+ if _, err := r.client.Retry(r.ctx, first); Status(err) != http.StatusConflict || !strings.Contains(err.Error(), "not_retryable") {
+ t.Fatalf("an older failed turn: %v", err)
+ }
+ if page := r.inst.Get(t, "/conversation"); !strings.Contains(page, `data-ended="`+second+`"><p>The coordinator could not answer this message.</p>`+retryForm(second)) {
+ t.Fatal("an unknown reason's note offers Try again")
+ }
+ // Someone else's turn is not theirs to try.
+ const member = "member@example.com"
+ if err := r.inst.Store.SetMember(context.Background(), equipo.Actor{Address: Owner}, member, equipo.RoleMember, true, 0); err != nil {
+ t.Fatal(err)
+ }
+ other := NewClient(r.inst.URL, r.inst.DeviceTokenFor(t, member))
+ if _, err := other.Retry(r.ctx, second); Status(err) != http.StatusNotFound {
+ t.Fatalf("another member's retry: %v", err)
+ }
+ if _, err := NewClient(r.inst.URL, "").Retry(r.ctx, second); Status(err) != http.StatusUnauthorized {
+ t.Fatalf("no bearer: %v", err)
+ }
+ // From another site, nothing happens.
+ if status, _ := r.tryAgain(second, "cross-site"); status != http.StatusForbidden {
+ t.Fatalf("cross-site Try again: %d", status)
+ }
+ if n := r.count("SELECT count(*) FROM chat_turns WHERE coalesce(retry_of, '') <> ''"); n != 0 {
+ t.Fatalf("%d retries queued by refused requests", n)
+ }
+ // A newer message running: the failed turn is history.
+ third := r.say(runner, "Three", "k3").TurnID
+ if _, err := r.client.Retry(r.ctx, second); Status(err) != http.StatusConflict {
+ t.Fatalf("with a newer turn running: %v", err)
+ }
+ if status, at := r.tryAgain(second, "same-origin"); status != http.StatusSeeOther || at != "/conversation" {
+ t.Fatalf("a stale Try again: %d %s", status, at)
+ }
+ r.failOn(runner, third, wire.ReasonAttachmentUnavailable, "")
+ page := r.inst.Get(t, "/conversation")
+ if !strings.Contains(page, `data-ended="`+third+`"><p>A file did not arrive whole on your runner. Attach it again.</p></li>`) {
+ t.Fatal("a missing file's note offers an action")
+ }
+ if _, err := r.client.Retry(r.ctx, third); Status(err) != http.StatusConflict {
+ t.Fatalf("retrying a missing file: %v", err)
+ }
+ if n := r.count("SELECT count(*) FROM chat_turns WHERE coalesce(retry_of, '') <> ''"); n != 0 {
+ t.Fatalf("%d retries queued by refused requests", n)
+ }
+}
+
+// Sign in again: the account's own row on Connections, not Try again.
+// A limit that has reset: Try again.
+func TestContractRetryAccountActions(t *testing.T) {
+ reset := time.Now().Add(-time.Minute).UTC()
+ r, runner := retryRig(t, []wire.HeldConnection{
+ {LocalID: "claude-a", Person: Owner, Provider: "claude", Kind: "subscription", Label: Owner, State: wire.ConnSignInAgain},
+ {LocalID: "claude-b", Person: Owner, Provider: "claude", Kind: "subscription", Label: "second@example.com", State: wire.ConnLimited, Headroom: &wire.Headroom{ResetsAt: &reset}},
+ })
+ conns, err := r.client.Connections(r.ctx)
+ if err != nil {
+ t.Fatal(err)
+ }
+ var signIn string
+ for _, c := range conns.Items {
+ if c.LocalID == "claude-a" {
+ signIn = c.ID
+ }
+ }
+ first := r.say(runner, "One", "k1").TurnID
+ r.failOn(runner, first, "sign_in_again", "claude-a")
+ page := r.inst.Get(t, "/conversation")
+ if signIn == "" || !strings.Contains(page, `data-ended="`+first+`"><p>Claude (owner@example.com) needs you to sign in again.</p><a rst-btn href="/conversation/settings/connections#connection-`+signIn+`" equipo-ended-action data-sign-in-again>Sign in again</a></li>`) {
+ t.Fatal("sign in again")
+ }
+ second := r.say(runner, "Two", "k2").TurnID
+ r.failOn(runner, second, "limited", "claude-b")
+ if page = r.inst.Get(t, "/conversation"); !strings.Contains(page, `data-ended="`+second+`"><p>Claude (second@example.com) reached its usage limit. Try again once it resets, or add another account.</p>`+retryForm(second)) {
+ t.Fatal("a limit that has reset")
+ }
+}
+
+// A retry waiting behind a move-in that gives way is a queued turn with
+// messages of its own, like any: a message sent meanwhile joins it as a
+// batch, and nothing in dispatch reads retry_of, so an instance rolled
+// back to a version without retries (which ignores the column) sends it
+// just the same. The dispatch code is that version's (8dc096b4).
+func TestContractRetryWaitingJoinsAndRollsBack(t *testing.T) {
+ r := newMoveInRig(t)
+ if _, err := r.client.Send(r.ctx, "hello", "k1"); err != nil {
+ t.Fatal(err)
+ }
+ failed := r.dispatched(wire.TurnPerson).TurnID
+ r.failOn(r.runner, failed, "policy_rejected", "")
+ moving := r.moveIn("r-mi-1", wire.TurnMoveIn)
+ retried, err := r.client.Retry(r.ctx, failed)
+ if err != nil || retried.State != wire.TurnQueued {
+ t.Fatalf("retry behind the move-in %+v %v", retried, err)
+ }
+ later, err := r.client.Send(r.ctx, "and this", "k2")
+ if err != nil || later.Turn.ID != retried.ID {
+ t.Fatalf("a message sent meanwhile %+v %v", later.Turn, err)
+ }
+ if own, left := r.count("SELECT count(*) FROM chat_messages WHERE turn_id = ? AND role = 'person'", retried.ID), r.count("SELECT count(*) FROM chat_messages WHERE turn_id = ?", failed); own != 2 || left != 0 {
+ t.Fatalf("the retry holds %d messages, the failed turn %d", own, left)
+ }
+ // The rolled-back version knows nothing of retry_of.
+ if _, err := r.inst.DB.Writer().Exec("UPDATE chat_turns SET retry_of = NULL"); err != nil {
+ t.Fatal(err)
+ }
+ if err := r.runner.Send(r.ctx, "r-t-y", wire.FrameTurn, wire.TurnReport{TurnID: moving.TurnID, Attempt: 1, State: wire.TurnCancelled, Reason: "cancelled"}); err != nil {
+ t.Fatal(err)
+ }
+ if cmd := r.dispatched(wire.TurnPerson); cmd.TurnID != retried.ID || strings.Join(cmd.PersonText, "|") != "hello|and this" {
+ t.Fatalf("the retry's frame %s %q", cmd.TurnID, cmd.PersonText)
+ }
+}
+
+// A retry the person stopped: they stopped those words, which ride no
+// further, as a stopped turn's never do.
+func TestContractRetryStoppedCarriesNothing(t *testing.T) {
+ r, runner := retryRig(t, nil)
+ failed := r.say(runner, "Old words", "k1").TurnID
+ r.failOn(runner, failed, "policy_rejected", "")
+ retried, err := r.client.Retry(r.ctx, failed)
+ if err != nil {
+ t.Fatal(err)
+ }
+ r.running(runner)
+ if _, err := r.client.Cancel(r.ctx, retried.ID); err != nil {
+ t.Fatal(err)
+ }
+ f, _, err := runner.Expect(r.ctx, wire.FrameCancel)
+ if err != nil {
+ t.Fatal(err)
+ }
+ runner.Send(r.ctx, "a-"+f.ID, wire.FrameAck, wire.Ack{ID: f.ID})
+ runner.Send(r.ctx, "c-"+retried.ID, wire.FrameTurn, wire.TurnReport{TurnID: retried.ID, Attempt: retried.Attempt, State: wire.TurnCancelled, Reason: "cancelled"})
+ r.turnIs(retried.ID, wire.TurnCancelled)
+ if page := r.inst.Get(t, "/conversation"); !strings.Contains(page, `data-ended="`+retried.ID+`"><p>Stopped.</p></li>`) {
+ t.Fatal("a stopped retry's note")
+ }
+ if next := r.say(runner, "New words", "k2"); strings.Join(next.PersonText, "|") != "New words" {
+ t.Fatalf("a stopped retry's words rode on %q", next.PersonText)
+ }
+}
diff --git a/internal/wire/wireschema/wireschema.go b/internal/wire/wireschema/wireschema.go
index 14832ea4..6f89a286 100644
--- a/internal/wire/wireschema/wireschema.go
+++ b/internal/wire/wireschema/wireschema.go
@@ -50,6 +50,7 @@ var Ops = map[string]Op{
"GET /attachments/{id}/preview": {nil, map[string]any{"200": Bytes{}}},
"GET /turns/{id}": {nil, map[string]any{"200": wire.Turn{}}},
"POST /turns/{id}/cancel": {nil, map[string]any{"202": wire.CancelAccepted{}}},
+ "POST /turns/{id}/retry": {nil, map[string]any{"202": wire.Turn{}}},
"GET /snapshot": {nil, map[string]any{"200": wire.Snapshot{}}},
"GET /projects": {nil, map[string]any{"200": wire.ProjectList{}}},
"POST /projects": {wire.AddProject{}, map[string]any{"200": wire.Project{}, "201": wire.Project{}}},