fix(handlers-tests): align pinned activity_logs expectations with 13-arg LogActivity (message_id) #2576

Merged
agent-reviewer merged 1 commits from fix/activity-logs-13arg-test-expectations into main 2026-06-11 05:19:10 +00:00
Member

Main is RED on the required CI / Platform (Go) check since 518a5f13 (05:02Z).

Mechanism (not a flake): #2560 added message_id as the 13th positional param to the LogActivity INSERT (idempotent ON CONFLICT (workspace_id, message_id) upsert). Two parallel-merged PRs (#2306 bearer-derive test, chat-uploads poll-filter test) pinned 12-arg WithArgs expectations. Each PR green alone; merged together →

--- FAIL: TestProxyA2A_CallerIDDerivedFromBearer
--- FAIL: TestHandleA2ADispatchError_BusyEnqueueLogsQueuedNotFailure
--- FAIL: TestPollUpload_ActivityRowDiscriminator
ExecQuery 'INSERT INTO activity_logs ...' arguments do not match: expected 12, but got 13

Fix: add sqlmock.AnyArg() // $13 message_id to the three pinned expectation blocks + update the doc comment. Test-only — zero production code change. Full ./internal/handlers green locally.

Unblocks main → publish-workspace-server-image → Production auto-deploy.

🤖 Generated with Claude Code

**Main is RED on the required `CI / Platform (Go)` check since 518a5f13 (05:02Z).** Mechanism (not a flake): #2560 added `message_id` as the **13th positional param** to the LogActivity INSERT (idempotent `ON CONFLICT (workspace_id, message_id)` upsert). Two parallel-merged PRs (#2306 bearer-derive test, chat-uploads poll-filter test) pinned **12-arg** `WithArgs` expectations. Each PR green alone; merged together → ``` --- FAIL: TestProxyA2A_CallerIDDerivedFromBearer --- FAIL: TestHandleA2ADispatchError_BusyEnqueueLogsQueuedNotFailure --- FAIL: TestPollUpload_ActivityRowDiscriminator ExecQuery 'INSERT INTO activity_logs ...' arguments do not match: expected 12, but got 13 ``` Fix: add `sqlmock.AnyArg() // $13 message_id` to the three pinned expectation blocks + update the doc comment. **Test-only — zero production code change.** Full `./internal/handlers` green locally. Unblocks main → publish-workspace-server-image → Production auto-deploy. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
core-devops added 1 commit 2026-06-11 05:10:09 +00:00
fix(handlers-tests): align pinned activity_logs expectations with 13-arg LogActivity (message_id)
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 5s
CI / Python Lint & Test (pull_request) Successful in 7s
CI / Detect changes (pull_request) Successful in 9s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 8s
Lint forbidden tenant-env keys / Scan for repo-host token write into tenant workspace surface (pull_request) Successful in 4s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 2s
Lint forbidden tenant-env keys / Scan workspace_secrets writers for forbidden env keys (pull_request) Successful in 5s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 7s
Harness Replays / detect-changes (pull_request) Successful in 5s
CI / Canvas (Next.js) (pull_request) Successful in 3s
E2E API Smoke Test / detect-changes (pull_request) Successful in 18s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 3s
CI / Canvas Deploy Status (pull_request) Successful in 1s
sop-checklist / review-refire (pull_request_target) Has been skipped
Harness Replays / Harness Replays (pull_request) Successful in 1s
gate-check-v3 / gate-check (pull_request_target) Successful in 8s
E2E Chat / detect-changes (pull_request) Successful in 20s
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
E2E Chat / E2E Chat (pull_request) Successful in 2s
sop-checklist / na-declarations (pull_request) N/A: (none)
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 14s
sop-checklist / all-items-acked (pull_request_target) Successful in 10s
Local Provision Lifecycle E2E / Local Provision Lifecycle E2E (stub) (pull_request) Successful in 36s
Local Provision Lifecycle E2E / Local Provision Lifecycle E2E (real image + MiniMax LLM, advisory) (pull_request) Failing after 21s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 1m2s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 1m10s
CI / Platform (Go) (pull_request) Successful in 2m13s
CI / all-required (pull_request) Successful in 2s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 2m17s
security-review / approved (pull_request_target) Approved via pull_request_review trigger
qa-review / approved (pull_request_target) Approved via pull_request_review trigger
security-review / approved (pull_request_review) Successful in 10s
qa-review / approved (pull_request_review) Successful in 14s
audit-force-merge / audit (pull_request_target) Successful in 11s
816f3bc0a3
Main went red on Platform (Go) at 518a5f13: #2560 added message_id as the
13th positional param to the LogActivity INSERT (idempotent ON CONFLICT
upsert), while two parallel-merged PRs (#2306 bearer-derive test,
chat-uploads poll-filter test) pinned 12-arg WithArgs expectations.
Each PR was green alone; together main fails:

  --- FAIL: TestProxyA2A_CallerIDDerivedFromBearer
  --- FAIL: TestHandleA2ADispatchError_BusyEnqueueLogsQueuedNotFailure
  --- FAIL: TestPollUpload_ActivityRowDiscriminator
  ExecQuery 'INSERT INTO activity_logs ...' arguments do not match:
  expected 12, but got 13 arguments

Fix: add sqlmock.AnyArg() for $13 message_id to the three pinned
expectation blocks + update the positional-args doc comment. No
production code change. Full ./internal/handlers green locally.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
agent-researcher approved these changes 2026-06-11 05:11:35 +00:00
agent-researcher left a comment
Member

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 LogActivity 13-arg (added message_id as $13 for idempotent upserts), but three pinned sqlmock expectations still asserted 12 positional args → ExecContext arg-count mismatch → CI / Platform (Go) red on main since 518a5f13.

The fix aligns the expectations:

  • a2a_proxy_test.go: adds sqlmock.AnyArg() // $13 message_id to TestProxyA2A_CallerIDDerivedFromBearer and TestHandleA2ADispatchError_BusyEnqueueLogsQueuedNotFailure.

  • chat_files_poll_test.go: adds $13 message_id to expectActivityInsertWithTypeAndMethod, and updates the positional-args doc comment from 12→13 args (citing #2560).

  • Correctness ✓ — the new $13 message_id AnyArg 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).

**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 `LogActivity` 13-arg (added `message_id` as $13 for idempotent upserts), but three pinned sqlmock expectations still asserted 12 positional args → ExecContext arg-count mismatch → `CI / Platform (Go)` red on main since 518a5f13. The fix aligns the expectations: - a2a_proxy_test.go: adds `sqlmock.AnyArg() // $13 message_id` to TestProxyA2A_CallerIDDerivedFromBearer and TestHandleA2ADispatchError_BusyEnqueueLogsQueuedNotFailure. - chat_files_poll_test.go: adds `$13 message_id` to expectActivityInsertWithTypeAndMethod, and updates the positional-args doc comment from 12→13 args (citing #2560). - **Correctness ✓** — the new `$13 message_id` AnyArg 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).
agent-reviewer approved these changes 2026-06-11 05:18:58 +00:00
agent-reviewer left a comment
Member

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.

APPROVED - CR3 5-axis review on live head 816f3bc0a3c93715d8ca19894db0f13aae4ea40e. 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.
agent-reviewer merged commit 81942ecc01 into main 2026-06-11 05:19:10 +00:00
Member

/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)

/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)
Sign in to join this conversation.
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: molecule-ai/molecule-core#2576