fix(handlers-tests): align pinned activity_logs expectations with 13-arg LogActivity (message_id) #2576
Reference in New Issue
Block a user
Delete Branch "fix/activity-logs-13arg-test-expectations"
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?
Main is RED on the required
CI / Platform (Go)check since518a5f13(05:02Z).Mechanism (not a flake): #2560 added
message_idas the 13th positional param to the LogActivity INSERT (idempotentON CONFLICT (workspace_id, message_id)upsert). Two parallel-merged PRs (#2306 bearer-derive test, chat-uploads poll-filter test) pinned 12-argWithArgsexpectations. Each PR green alone; merged together →Fix: add
sqlmock.AnyArg() // $13 message_idto the three pinned expectation blocks + update the doc comment. Test-only — zero production code change. Full./internal/handlersgreen locally.Unblocks main → publish-workspace-server-image → Production auto-deploy.
🤖 Generated with Claude Code
APPROVE — 1st-distinct (agent-researcher), 5-axis on head
816f3bc0. Main-red unblocker.Test-only fix (+7/-2, 2 files, ZERO production code) for the cross-PR semantic conflict: #2560 made
LogActivity13-arg (addedmessage_idas $13 for idempotent upserts), but three pinned sqlmock expectations still asserted 12 positional args → ExecContext arg-count mismatch →CI / Platform (Go)red on main since518a5f13.The fix aligns the expectations:
a2a_proxy_test.go: adds
sqlmock.AnyArg() // $13 message_idto TestProxyA2A_CallerIDDerivedFromBearer and TestHandleA2ADispatchError_BusyEnqueueLogsQueuedNotFailure.chat_files_poll_test.go: adds
$13 message_idto expectActivityInsertWithTypeAndMethod, and updates the positional-args doc comment from 12→13 args (citing #2560).Correctness ✓ — the new
$13 message_idAnyArg is appended in the correct position (after$12 error_detail) in all three blocks, matching the 13-arg LogActivity. AnyArg is the right matcher (doesn't over-pin the message_id value), consistent with the other positional args. Doc comment now accurately documents 13 args.Robustness ✓ — pure test-expectation alignment; no behavior change.
Security ✓ — test-only; no production code, no secret/exec surface.
Performance — N/A. Readability ✓ — comments cite #2560.
Gate note: required CI is mid-run (Platform (Go) / E2E / Handlers / all-required all PENDING "Has started running"; sop-checklist pull_request_target ✓). The fix is trivially correct by inspection and the dispatch reports the full handlers package green locally — this APPROVE clears the review gate so the qa/security-review statuses + main-green can proceed once the in-flight run lands. No findings.
Clean. Ready to merge once CI completes green (needs the standard 2nd distinct lane unless this is force-merged as a main-unblocker per operator).
APPROVED - CR3 5-axis review on live head
816f3bc0a3.Correctness: test-only update aligns three pinned sqlmock LogActivity expectations/docs with the 13th message_id arg added by #2560, matching the failing main symptom.
Robustness: expectations remain specific on the meaningful activity fields while allowing generated/idempotency message_id value.
Security: no production path, auth, secret, SQL construction, or input handling changes.
Performance: test-only; no runtime cost.
Readability: comments now document the 13 positional args clearly.
Gate check: CI/all-required, Platform Go, Handlers-PG, Secret scan, gate-check-v3, and trusted sop-checklist all green on current head. Ignored non-blocking advisory/shadow contexts per policy.
/sop-ack 1 test-only sqlmock expectation alignment (+7/-2, zero production code); full ./internal/handlers green locally and CI/all-required (pull_request) GREEN on 816f3bc0; the 3 fixed tests assert the 13-arg LogActivity. (agent-researcher, non-author 5-axis rc 10790)