channels: add SendAdapter injection + handler test coverage for Test and Send #994

Merged
devops-engineer merged 1 commits from fix/993-agent-handler-test-coverage into staging 2026-05-14 12:36:25 +00:00

1 Commits

Author SHA1 Message Date
9edc0036a3 channels: add SendAdapter injection + handler test coverage for Test and Send
Some checks failed
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 9s
Harness Replays / detect-changes (pull_request) Successful in 7s
CI / Detect changes (pull_request) Successful in 16s
E2E API Smoke Test / detect-changes (pull_request) Successful in 17s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 17s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 7s
qa-review / approved (pull_request) Successful in 8s
Runtime PR-Built Compatibility / detect-changes (pull_request) Successful in 16s
security-review / approved (pull_request) Successful in 7s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 1m8s
CI / Canvas (Next.js) (pull_request) Successful in 5s
Harness Replays / Harness Replays (pull_request) Successful in 4s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 4s
CI / Python Lint & Test (pull_request) Successful in 3s
Runtime PR-Built Compatibility / PR-built wheel + import smoke (pull_request) Successful in 3s
CI / Canvas Deploy Reminder (pull_request) Successful in 4s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 1m28s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 3m16s
CI / Platform (Go) (pull_request) Failing after 5m30s
CI / all-required (pull_request) Successful in 3s
gate-check-v3 / gate-check (pull_request) Successful in 16s
sop-tier-check / tier-check (pull_request) Successful in 14s
sop-checklist / na-declarations (pull_request) awaiting /sop-n/a declaration for: qa-review, security-review
sop-checklist / all-items-acked (pull_request) [info tier:low] acked: 5/7 — missing: root-cause, no-backwards-compat — body-unfilled: five-axis-review, no-backwards-compat, memory-consult
audit-force-merge / audit (pull_request) Successful in 18s
- Extract SendAdapter interface (SendMessage only) from ChannelAdapter so
  tests can inject a MockSendAdapter without hitting real Telegram/Slack APIs
- Make GetSendAdapter a package-level var (default: real adapters; tests
  override via SetGetSendAdapter from channels/testing.go)
- Wire GetSendAdapter into Manager.SendOutbound (was GetAdapter → ChannelAdapter)
- Add 4 handler tests in handlers/channels_test.go:
    TestChannelHandler_Test_Success         — full send-outbound success path
    TestChannelHandler_Test_ChannelNotFound — loadChannel error → 500
    TestChannelHandler_Send_Success         — budget pass → send → 200
    TestChannelHandler_Send_ChannelNotFound — loadChannel error → 500

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 09:30:11 +00:00