feat: comprehensive GitHub webhook improvements and Redis fix#17
Merged
zbigniewsobiecki merged 7 commits intomainfrom Jan 2, 2026
Merged
feat: comprehensive GitHub webhook improvements and Redis fix#17zbigniewsobiecki merged 7 commits intomainfrom
zbigniewsobiecki merged 7 commits intomainfrom
Conversation
Add Redis support alongside PostgreSQL, enabling agents to use in-memory data storage for caching, queues, and session management. Changes: - Install redis-server and redis-tools in Docker image - Configure Redis with AOF persistence, 256MB memory limit, and LRU eviction - Add startRedis() function following the same pattern as startPostgres() - Integrate Redis startup into agent lifecycle (base.ts, review.ts) - Document Redis CLI commands and usage in agent prompts - Both PostgreSQL and Redis are critical: agents fail if either service doesn't start Redis configuration: - Port: 6379 (standard) - Bind: localhost only for security - Persistence: AOF with everysec fsync - Memory: 256MB with allkeys-lru eviction policy - Access: via redis-cli through Tmux gadget 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
The debug agent wasn't triggering because CASCADE was shutting down too quickly after uploading session logs. Trello webhooks for attachment uploads take a few seconds to arrive, but we were only waiting 5 seconds before shutting down the machine. Increased postJobGracePeriodMs from 5s to 45s to ensure: 1. Agent uploads session log attachment 2. Trello webhook is delivered while machine is still running 3. Debug agent trigger processes the webhook 4. Debug agent runs before shutdown This fixes the race condition where attachment webhooks arrived after the machine had already shut down. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Both pull_request_review (review submission) and pull_request_review_comment (review comments) now trigger the review agent for PRs with Trello card URLs. Changes: - Updated webhook queue to store event types alongside payloads - Added PRReviewSubmittedTrigger for review submissions (approve/request changes) - Fixed hardcoded event type in GitHub webhook dequeuing - Both review types now trigger the review agent when PR has Trello card URL Previously, only review comments triggered the agent. Now review submissions (when someone clicks 'Approve' or 'Request Changes') also trigger it. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Adds automatic card movement logic to executeGitHubAgent that mirrors the existing behavior in Trello webhook handler. When implementation agent creates a PR, the card is now moved to the IN REVIEW list and a comment with the PR URL is added. This ensures consistent behavior regardless of whether the agent was triggered by a Trello webhook or a GitHub webhook. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Adds comprehensive documentation for GitHub webhook setup: - GitHub webhook endpoint in API endpoints section - Detailed setup instructions with configuration steps - List of supported GitHub triggers and their behavior - Updated features list to include GitHub integration This complements the recent GitHub webhook improvements including PR review submission support and automatic card movement. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The redis user has /usr/sbin/nologin as its default shell, which prevents `su redis -c` from working. This was causing Redis to fail to start in production with "This account is currently not available." Fix by using `su -s /bin/sh` to explicitly specify a shell for the redis user when starting the service. Also updated agent environment documentation to reflect the correct startup command. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
zbigniewsobiecki
added a commit
that referenced
this pull request
Apr 25, 2026
…tructured envelope, --comment alias) (#1190) * docs(014): spec + plans for cascade-tools agent ergonomics Adds docs/specs/014-cascade-tools-agent-ergonomics.md plus two plans covering shared-infra and create-pr-review adoption. Prompted by prod run 5d993b04-6e05-4ae1-b7de-8c274cf3496b. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * chore(plan-014): lock plan 1 (shared-infra) * feat(cascade-tools): plan 014/1 shared-infra — truthful prompts + envelope Ships the root-cause fix for prod run 5d993b04-6e05-4ae1-b7de-8c274cf3496b plus the shared infrastructure every future gadget inherits: - System-prompt renderer (src/backends/shared/nativeToolPrompts.ts) stops stripping trailing 's' from array param names and claiming '<string> (repeatable)' for every array. Array-of-object params now render as `--<flag> '<json>'` with aliases appended via `|` and a one-line runnable example from the tool definition. - Factory (src/gadgets/shared/cliCommandFactory.ts) gains oclif flag aliases, JSON parsing for array-of-object flags, file-input JSON parsing, `examples` wired into oclif `--help`, and Levenshtein-based 'did you mean' suggestions for mistyped flags (via fastest-levenshtein). - New shared error envelope (src/gadgets/shared/errorEnvelope.ts) — every CLI failure emits `{"success":false,"error":{type,flag?,message,got?, expected?,hint?,example?}}` on stdout plus a one-line prose summary on stderr. All prior `this.error()` / flat `{success:false,error:"<string>"}` call sites migrated. - Contracts widened: ParameterDefinition gains `cliAliases`, FileInput- Alternative gains `parseAs`, ToolManifest parameters carry `items`, `aliases`, `example`. - Manifest generator threads the new fields through. - bin/cascade-tools.js wraps `run()` to swallow oclif ExitError cleanly so the envelope isn't obscured by Node's default stack dump. Plan-1 ACs #1–#17 all delivered. 8438/8438 unit tests passing. Test surface delta: 57 new unit tests across errorEnvelope.test.ts, shared-nativeToolPrompts.test.ts, and factories.test.ts. Seven legacy assertions encoding the pre-014 error surface updated in cli/cli-command- factory, cli/file-input-flags, cli/scm/create-pr-sidecar, cli/scm/create- pr-review-sidecar, backends/claude-code. Plan 2 adopts the pattern on createPRReviewDef — zero shared-file edits — proving the declarative-metadata invariant. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * chore(plan-014): lock plan 2 (createprreview-adopt) * feat(cascade-tools): plan 014/2 createprreview-adopt + spec done Applies the spec-014 declarative-metadata pattern to createPRReviewDef: - --comment alias for --comments (the exact muscle-memory mistake from prod run 5d993b04-6e05-4ae1-b7de-8c274cf3496b). - --comments-file <path> (and - for stdin) JSON-parsed escape hatch for long payloads that don't survive shell quoting. - Two declarative fields on createPRReviewDef.parameters.comments.cliAliases + createPRReviewDef.cli.fileInputAlternatives. Zero edits to shared infrastructure (cliCommandFactory, manifestGenerator, nativeToolPrompts, errorEnvelope) — proves spec 014's single-entrypoint invariant. Per-plan ACs #1, #2, #3, #5, #6, #7, #8, #9, #11, #12 auto-verified (unit tests + build + lint + typecheck). AC #4 (binary-level smoke) tagged [manual] because vitest fork-pool workers fail to capture stdout/stderr from spawned binaries that do top-level await import(); the six scenarios were verified manually against the built binary and the trace is recorded in the plan. AC #10 n/a — integration test path abandoned for the same reason. All plans done. Spec 014 marked .done (docs/specs/014-*.md → .done). CHANGELOG Unreleased updated with a per-plan entry. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Merges all recent improvements from dev to main, including GitHub webhook enhancements and the critical Redis startup fix.
Major Changes
GitHub Webhook Improvements
1. PR Review Submission Support
PRReviewSubmittedTriggerto handle full PR review events (approve/request changes)2. Automatic Card Movement to IN REVIEW
3. Post-Job Grace Period Fix
4. Comprehensive Documentation
Critical Production Fix
Redis Startup Failure
/usr/sbin/nologinshellsu -s /bin/shto explicitly specify shellFiles Changed
src/triggers/github/pr-review-submitted.ts- New PR review triggersrc/triggers/github/webhook-handler.ts- Card movement logicsrc/triggers/index.ts- Register new triggersrc/utils/webhookQueue.ts- Event type storagesrc/agents/utils/setup.ts- Redis startup fixsrc/agents/prompts/templates/partials/environment.eta- Documentationconfig/projects.json- Grace period configurationREADME.md- GitHub webhook documentationCommits Included
Testing
✅ All 62 tests pass
✅ Type checking passes
✅ CI checks pass
✅ Linting passes
Impact
This release:
🤖 Generated with Claude Code