feat: manual debug analysis triggering and automatic base branch for PRs#304
Merged
zbigniewsobiecki merged 1 commit intodevfrom Feb 16, 2026
Merged
feat: manual debug analysis triggering and automatic base branch for PRs#304zbigniewsobiecki merged 1 commit intodevfrom
zbigniewsobiecki merged 1 commit intodevfrom
Conversation
Add on-demand debug analysis for any agent run via CLI, web UI, and tRPC API. Previously, debug analysis only ran automatically for failed/timed_out runs. Now users can analyze any run (including successful ones for efficiency review) and re-run analysis on already-analyzed runs. Changes: - Add triggerDebugAnalysis tRPC mutation and getDebugAnalysisStatus query - Add --analyze and --wait flags to `cascade runs debug` CLI command - Add Run Analysis / Re-run Analysis buttons in web UI with auto-polling - Add in-memory analysis status tracker (debug-status.ts) - Add deleteDebugAnalysisByRunId for replace-on-rerun - Fix severity field: use 'manual' for non-failure/non-timeout runs Also makes PR base branch automatic via CASCADE_BASE_BRANCH env var: - create-pr CLI: --base defaults to CASCADE_BASE_BRANCH env var - adapter: injects project.baseBranch as CASCADE_BASE_BRANCH into secrets - Remove --base from CreatePR tool manifest (agents no longer specify it) - Update implementation prompt and git partial to stop specifying --base Co-Authored-By: Claude Opus 4.6 <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
--analyze/--waitflags, and web UI "Run Analysis" / "Re-run Analysis" buttons with auto-polling.create-prtool now auto-resolves the target base branch fromCASCADE_BASE_BRANCHenv var (injected from project config), removing a common source of agent errors where the wrong--basewas specified.Changes
Manual Debug Analysis (CLI + Web UI + API)
src/triggers/shared/debug-status.ts— New in-memory tracker for running analysessrc/triggers/shared/debug-runner.ts— Integrate status tracker; fix severity to'manual'for non-failure runssrc/db/repositories/runsRepository.ts— AdddeleteDebugAnalysisByRunIdfor replace-on-rerunsrc/api/routers/runs.ts— AddtriggerDebugAnalysismutation +getDebugAnalysisStatusquerysrc/cli/dashboard/runs/debug.ts— Add--analyzeand--waitflagsweb/src/components/debug/debug-analysis.tsx— Run/Re-run Analysis buttons with pollingCLAUDE.md— Document new CLI flagsAutomatic PR Base Branch
src/backends/adapter.ts— InjectCASCADE_BASE_BRANCHfromproject.baseBranchinto project secretssrc/cli/github/create-pr.ts—--basedefaults toCASCADE_BASE_BRANCHenv varsrc/agents/prompts/templates/implementation.eta— Stop instructing agents to specify--basesrc/agents/prompts/templates/partials/git.eta— Remove--baseinstructionTests
tests/unit/triggers/debug-status.test.ts(6 tests)tests/unit/triggers/debug-runner.test.ts(+3 tests: status tracker calls, severity: manual)tests/unit/api/routers/runs.test.ts(+12 tests: getDebugAnalysisStatus, triggerDebugAnalysis)tests/unit/api/router.test.ts(+2 procedure assertions, new mocks)tests/unit/db/runsRepository.test.ts(+1 test: deleteDebugAnalysisByRunId)tests/unit/backends/adapter.test.ts(2 tests updated for CASCADE_BASE_BRANCH injection)Test plan
npm run typecheckpassesnpm run lintcleannpm test— 83 files, 1266 tests all passnpm run build:websucceedscascade runs debug <id> --analyzetriggers analysis🤖 Generated with Claude Code