fix(e2e): surface/fix saas step-9 HMA memory POST #2315
Reference in New Issue
Block a user
Delete Branch "fix/e2e-saas-step9-hma-surface"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Staging-saas e2e step 9/11 "Writing + reading HMA memory on parent" failed in run 223471 (main) with a bare:
The
POST /workspaces/:id/memoriesreturned HTTP 500, but the test did… -d "$MEM_PAYLOAD" >/dev/null || fail "memory POST failed"— discarding the response body that--fail-with-body(inCURL_COMMON) deliberately preserves on a non-2xx. So we got the status (via curl's stderr line) and nothing about which 500 path fired. This is the same #2310-class opacity that was already fixed fortenant_call/A2A and step-9b, but step-9a (memory write) + the read-back were missed.Mechanism (named, not "flaky")
The workspace-server
memories.goCommithandler returns 500 from exactly two branches:failed to resolve writable namespaces(namespace resolver error)failed to store memory(v2 memory pluginCommitMemoryreturned an error — logged server-side asCommit memory error (plugin): %v)…and 503 for
memory plugin is not configured (set MEMORY_PLUGIN_URL). We got 500, not 503, so the plugin IS wired; the write hit one of the two 500 branches. The test payload{content, scope: LOCAL}matches the handler contract exactly (a bad shape would be 400), so this is NOT a stale-endpoint/payload bug, and auth/readiness are ruled out (provisioning, A2A real completions, and config PUT all succeeded with the same token seconds earlier).We cannot name which 500 branch without the body — and the body is exactly what the test threw away. Hence this fix is the necessary first step.
Change (test-only)
Capture
http_code(-w) + body (-o) for both the memory write and the read-back, thenfailwith the sanitized status+body — mirroring the already-hardened step-9b / A2A pattern in this same file. No production code touched.bash -n: cleanshellcheck: exit 0, no findingsNext
Re-run staging-saas: the next failure (if it persists) will print the exact 500 body, letting us name namespace-resolve vs plugin-write and decide whether a workspace-server HMA fix is warranted. Production HMA was deliberately not modified.
🤖 Generated with Claude Code
APPROVED (CTO review). Verified: tests/e2e ONLY (+36/-4), zero prod code. Surfaces the HMA memory write+read-back HTTP status+sanitized body on non-2xx (the step-9 500 was opaque, #2310-class). No assertion/gating change. Correct + needed to name the 500. Approving.