Skip to content

webhooks: fix agentRoutes no-op routing + gws in image#19

Merged
jhs129 merged 3 commits intomainfrom
raw-webhooks
Mar 28, 2026
Merged

webhooks: fix agentRoutes no-op routing + gws in image#19
jhs129 merged 3 commits intomainfrom
raw-webhooks

Conversation

@jhs129
Copy link
Copy Markdown
Owner

@jhs129 jhs129 commented Mar 28, 2026

Hey! Quick follow-up to PR #18 — Greptile flagged a real bug where agentRoutes was silently doing nothing, plus a couple of staging hardening improvements.

Summary

  • Bug fix: agentRoutes was declared in the config type and schema but dropped in resolveWebhooksConfig — any user with hooks.webhooks.agentRoutes: { "shopify": "peterino" } would silently get default-agent routing. Now threads all the way through to CronJob.agentId.
  • Dockerfile: bake @googleworkspace/cli (gws) into the image so it's always available on fresh deploys, not dependent on the persistent volume.
  • staging-up.sh: sync OAuth token files, gws-config, and gh auth from prod on every staging provision so tool checks pass out of the box.

Changes

File What
webhooks-http.ts Add agentRoutes to WebhooksConfigResolved; pass agentId to dispatch
server/webhooks.ts Set agentId on CronJob; add to inline parameter type
hooks.ts Pass agentRoutes through resolveWebhooksConfig
webhooks-http.test.ts 2 new tests for routed/unrouted presets
Dockerfile Add @googleworkspace/cli to npm install block
scripts/staging-up.sh Sync token files, gws-config, gh hosts from prod

Test plan

  • pnpm build clean
  • pnpm check — 0 warnings, 0 errors
  • All tests pass
  • Deployed to staging and smoke tested
  • Deployed to production

🤖 Generated with Claude Code

John Schneider and others added 3 commits March 28, 2026 16:06
agentRoutes was declared in config types and schema but dropped in
resolveWebhooksConfig and never passed to the dispatch call. Any user
with hooks.webhooks.agentRoutes configured would silently get no-op
routing.

- Add agentRoutes to WebhooksConfigResolved
- Pass agentRoutes through in resolveWebhooksConfig
- Add agentId to dispatchAgentHook parameter type
- Look up agentRoutes[source] and pass as agentId in dispatch call
- Set agentId on CronJob in server/webhooks.ts so isolated-agent uses it
- 2 new tests: routed preset passes agentId, unrouted preset omits it

Co-Authored-By: Claude Sonnet 4.6 (1M context) <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <[email protected]>
@jhs129 jhs129 merged commit f16e66e into main Mar 28, 2026
4 of 10 checks passed
@jhs129 jhs129 deleted the raw-webhooks branch March 28, 2026 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant