Files
Molecule AI Dev Engineer B (MiniMax) ff9874e9c3
E2E Staging SaaS (full lifecycle) / E2E Staging Concierge Creates Workspace (pull_request) Has been skipped
E2E Staging SaaS (full lifecycle) / E2E Staging Concierge user_tasks (pull_request) Has been skipped
E2E Staging SaaS (full lifecycle) / E2E Staging Concierge Platform Agent (pull_request) Has been skipped
CI / Python Lint & Test (pull_request) Successful in 3s
E2E API Smoke Test / detect-changes (pull_request) Successful in 5s
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 7s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 4s
Lint forbidden tenant-env keys / Scan for repo-host token write into tenant workspace surface (pull_request) Successful in 4s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 2s
sop-checklist / review-refire (pull_request_target) Has been skipped
gate-check-v3 / gate-check (pull_request_target) Successful in 4s
Harness Replays / detect-changes (pull_request) Successful in 8s
Lint forbidden tenant-env keys / Scan workspace_secrets writers for forbidden env keys (pull_request) Successful in 7s
reserved-path-review / reserved-path-review (pull_request_target) Successful in 4s
sop-checklist / all-items-acked (pull_request_target) Successful in 4s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 7s
Harness Replays / Harness Replays (pull_request) Successful in 1s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 15s
E2E Staging SaaS (full lifecycle) / pr-validate (pull_request) Successful in 15s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 2s
CI / Detect changes (pull_request) Successful in 20s
E2E Chat / detect-changes (pull_request) Successful in 19s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 1s
CI / Canvas (Next.js) (pull_request) Successful in 2s
CI / Canvas Deploy Status (pull_request) Successful in 1s
E2E Staging SaaS (full lifecycle) / E2E Staging Concierge (compile+skip) (pull_request) Successful in 26s
E2E Peer Visibility (literal MCP list_peers) / E2E Peer Visibility (local) (pull_request) Successful in 30s
E2E Peer Visibility (literal MCP list_peers) / E2E Peer Visibility (pull_request) Successful in 6s
E2E Chat / E2E Chat (pull_request) Successful in 10s
Local Provision Lifecycle E2E / Local Provision Lifecycle E2E (stub) (pull_request) Successful in 34s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 57s
Local Provision Lifecycle E2E / Local Provision Lifecycle E2E (real image + MiniMax LLM, advisory) (pull_request) Failing after 25s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 2m23s
CI / Platform (Go) (pull_request) Successful in 2m49s
CI / all-required (pull_request) Successful in 2s
E2E Staging SaaS (full lifecycle) / E2E Staging Platform Boot (pull_request) Failing after 5m13s
security-review / approved (pull_request_target) Review check failed via pull_request_review trigger
reserved-path-review / reserved-path-review (pull_request_review) Successful in 9s
qa-review / approved (pull_request_target) Review check failed via pull_request_review trigger
security-review / approved (pull_request_review) Failing after 10s
qa-review / approved (pull_request_review) Failing after 11s
sop-checklist / all-items-acked (pull_request) acked: 0/7 — missing: comprehensive-testing, local-postgres-e2e, staging-smoke, +4 — body-unfilled: comprehensive-testing, local-postgres-e2
sop-checklist / na-declarations (pull_request) N/A: (none)
E2E Staging SaaS (full lifecycle) / E2E Staging SaaS (pull_request) Failing after 8m30s
test(workspace-server): regression tests for core#2125 (http timeout + panic recovery)
CTO-mandated regression test for the core#2125 family
("fix(workspace-server): http client timeouts, panic recovery, and
error checks"). The fix landed in main with NO test, despite
introducing 4 production-affecting behavior changes:

  (1) http.DefaultClient → &http.Client{Timeout: 10*time.Second} in
      cmd/server/cp_config.go:refreshEnvFromCP
  (2) inline defer-recover blocks in 6 long-lived background
      goroutines (cache sweepers, rate-limit cleanup, session cache,
      A2A SSE idle watcher, terminal bridges, importer provision
      goroutine)
  (3) ctx propagation in discovery.go's queryPeerMaps (use
      QueryRowContext)
  (4) deferred tx.Rollback in workspace.go's Create handler

The CTO's spec asks for tests of the timeout and panic-recovery
facets. This PR lands:

NEW TestRefreshEnvFromCP_ClientTimeoutFiresOnSlowUpstream — proves
the 10s client.Timeout actually fires on a slow upstream. Spins up
an httptest server that delays 12s (longer than the 10s timeout);
asserts refreshEnvFromCP returns an error within 11s AND the error
mentions timeout/deadline. Without the timeout, the test would
block for 12s+ AND the function would return success — the
elapsed-time bound proves the timeout fired, not the server.
Skipped in -short mode (10s wall cost, acceptable for CI).

NEW TestRecoverPanic_RecoversFromPanicInGoroutine + the
NoopOnNormalReturn companion — proves the canonical #2125
panic-recovery pattern. The inline  blocks (duplicated across 6 call sites) were
refactored into a single  helper in
session_auth.go. The tests assert:
  - a goroutine that defers recoverPanic and then panics does NOT
    crash the test process
  - the recovered value is logged with the caller's prefix (so
    operators can grep for the specific goroutine)
  - the goroutine's deferred epilogue (e.g. close(done)) still
    runs after the panic
  - recoverPanic is a no-op on a normal return (no spurious
    'PANIC' log)

Refactor note: the other 5 goroutines that #2125 wrapped
(terminal.go × 3, a2a_proxy.go × 1, bundle/importer.go × 1,
ratelimit.go × 1, mcp_ratelimit.go × 1) still use the inline
pattern. The refactor to recoverPanic could be applied to those
in a follow-up — kept this PR focused on the test mandate. The
new recoverPanic helper is in session_auth.go (the package that
already had the most inline recover blocks) and the test in
panic_recovery_test.go covers the contract for ALL future call
sites.

Error-path coverage (CTO spec (c)) is already provided by the
existing TestRefreshEnvFromCP_NonOKPropagates (CP 500 propagates
as error) and TestRefreshEnvFromCP_RejectsOversizedValue
(oversized value rejected, no env poisoning) — no new test
needed.

Test results:
  ok  workspace-server/cmd/server                            10.016s
  ok  workspace-server/internal/middleware                    0.100s
  go vet clean.

Refs: molecule-core#2615, core#2125

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-12 02:35:38 +00:00
..