Repository navigation
fix(trace): preselect configured harnesses when re-running trace init - #3548
Conversation
Re-running chainloop trace init ticked only Claude Code in the harness prompt, even when the repository was already set up for others. Each provider can now report whether its Chainloop hooks are installed, and init preselects those harnesses, falling back to Claude Code on a first run. Fixes PFM-7633 Assisted-by: Claude Code Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev> Chainloop-Trace-Sessions: d9398d05-28da-4a58-a25e-31e0ee714c92
PR validation — ✅ 3 passing
AI Session Checks — 🟢 91% · ✅ 0 failing
|
| Status | Attribution | File | Lines |
|---|---|---|---|
| modified | ai | app/cli/cmd/trace_init_providers_test.go |
+90 / -4 |
| created | ai | app/cli/internal/trace/providers/hooks_installed_test.go |
+69 / -0 |
| modified | ai | app/cli/internal/trace/claude/hooks_test.go |
+42 / -0 |
| modified | ai | app/cli/internal/trace/cursor/hooks_test.go |
+42 / -0 |
| modified | ai | app/cli/cmd/trace_init_providers.go |
+33 / -4 |
| modified | ai | app/cli/internal/trace/claude/hooks.go |
+20 / -0 |
| modified | ai | app/cli/internal/trace/cursor/hooks.go |
+20 / -0 |
| modified | ai | app/cli/internal/trace/opencode/hooks.go |
+11 / -0 |
| modified | ai | app/cli/cmd/trace_init.go |
+4 / -3 |
| modified | ai | app/cli/documentation/cli-reference.md |
+3 / -2 |
| modified | ai | app/cli/internal/trace/provider.go |
+5 / -0 |
Policies (4)
| Status | Policy | Material | Messages |
|---|---|---|---|
| ✅ Passed | ai-config-ai-agents-allowed |
ai-coding-session-d9398d |
- |
| ✅ Passed | ai-config-no-dangerous-commands |
ai-coding-session-d9398d |
- |
| ✅ Passed | ai-config-no-secrets |
ai-coding-session-d9398d |
- |
| ✅ Passed | ai-config-mcp-servers-allowed |
ai-coding-session-d9398d |
- |
Security Checks — ✅ 5 passing
✅ secret-scan
| Status | Policy | Messages |
|---|---|---|
| ✅ Passed | secrets-detection |
- |
✅ sast-scan
| Status | Policy | Messages |
|---|---|---|
| ✅ Passed | owasp-top10-2025 |
- |
| ✅ Passed | sast |
- |
| ✅ Passed | cwe-top25 |
- |
| ✅ Passed | cwe-top26-40-cusp |
- |
Scans not applied (3)
| Scan | Reason |
|---|---|
vulnerability-scan |
no manifest/lockfile changed |
github-actions-scan |
no workflow files changed |
iac-scan |
no IaC files changed |
Security context
✅ Nothing this change touches has a recorded security-fix history.
View in Chainloop ↗ · How this works ↗
Powered by Chainloop and Chainloop Trace
Re-running
chainloop trace initin a repository that was already set up ticked only Claude Code in the "Harnesses to trace in this repository" prompt, even when the repository also traced Cursor or opencode.Each trace provider can now report whether its Chainloop hooks are installed in the repository (
HooksInstalled). On a re-run, init preselects those harnesses and falls back to Claude Code on a first run. Hooks the user wrote are ignored, a harness configuration that cannot be read is treated as not set up so it cannot stop init, and the repository is only read when the prompt is actually shown. Harness flags and non-interactive runs behave as before.Fixes PFM-7633
This change was made with AI assistance (Claude Code).
🤖 Posted by Maximus bot (Claude Code) on behalf of @migmartri