feat: Add incident-copilot kit#183
Conversation
An investigation agent for on-call engineers. Paste a production alert and it grounds ranked root-cause hypotheses in runbooks (RAG) and recent GitHub activity (apiNode tool call), surfaces supporting AND contradicting evidence, uses incident-scoped memory so follow-up information revises the ranking instead of restarting, and drafts a hedged Slack update plus a blameless postmortem skeleton. Showcases RAG, tool calling, memory, structured output (InstructorLLMNode), multiple flows, prompts, model-configs, and a constitution. App typechecks and builds clean (Next 16 / React 19).
WalkthroughIncident Copilot is added as a new kit with Lamatic investigate and draft-comms flows, supporting prompts/configs/memory, a Next.js app, setup files, and demo documentation/assets. ChangesIncident Copilot Kit
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
:robot_face: AgentKit Structural ValidationNew Contributions Detected
Check Results
🎉 All checks passed! This contribution follows the AgentKit structure. |
There was a problem hiding this comment.
Actionable comments posted: 9
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@kits/incident-copilot/apps/app/globals.css`:
- Around line 1-156: The stylesheet is still fully custom CSS instead of the
required Tailwind/shadcn styling stack. Replace the handcrafted rules in
globals.css with Tailwind v4 base/theme/utilities-driven styles and move
component styling to shadcn/ui patterns used by the app’s React components. Also
update the app setup to include the missing Tailwind/PostCSS dependencies and
ensure the layout imports the global Tailwind stylesheet so the styling system
matches the mandated stack.
In `@kits/incident-copilot/apps/app/page.tsx`:
- Line 152: The error banner in page.tsx is missing live-region semantics, so
screen readers may not announce failures automatically. Update the conditional
error rendering in the page component to include accessible alert behavior, such
as adding an alert role and an appropriate aria-live setting, while keeping the
existing error message display logic in place.
- Around line 183-186: The “Draft Slack + postmortem” action is only disabled by
commsBusy, so it can still run while an investigation is active and the
hypothesis set may change. Update the button in the page component that renders
onDraftComms to also gate on busy, so drafting cannot start during
runInvestigation. Keep the label/disabled behavior consistent with the existing
commsBusy loading state.
In `@kits/incident-copilot/apps/components/hypothesis-card.tsx`:
- Around line 28-35: The Contradicting section in hypothesis-card.tsx renders an
empty <ul> when hypothesisCard’s contradictingEvidence array has no items,
unlike the supportingEvidence block. Update the HypothesisCard rendering so the
contradiction list has the same empty-state fallback as the supporting section,
showing a clear “None cited.” message when h.contradictingEvidence is empty. Use
the existing h.contradictingEvidence map block and match the conditional
rendering pattern already used for supportingEvidence.
In `@kits/incident-copilot/flows/investigate.ts`:
- Around line 97-100: The investigate flow references missing script modules, so
update the flow setup to point `codeNode_parse` and `codeNode_changes` at valid
script locations or add the missing `@scripts/investigate_parse-repo.ts` and
`@scripts/investigate_shape-changes.ts` files. Check the `investigate` flow
wiring and the related code node references so the script paths resolve
correctly at runtime.
In `@kits/incident-copilot/model-configs/draft-comms_postmortem.ts`:
- Around line 4-15: The draft postmortem config comment mentions a low
temperature (~0.3), but the exported object in draft-comms_postmortem.ts does
not include a temperature setting. Update the default export so the
configuration explicitly sets the same temperature value used by the related
diagnose and slack config objects, keeping the field on the model config object
alongside generativeModelName and the other properties.
In `@kits/incident-copilot/model-configs/draft-comms_slack.ts`:
- Around line 4-15: The draft-comms Slack model config is missing the
temperature setting that the comment calls for, and the current fields are still
self-referencing placeholders. Update the exported object in
draft-comms_slack.ts to include a temperature value around 0.5, and replace the
stubbed credentials, memories, messages, and attachments entries with the
intended real configuration values or references used by the other model-config
files.
In `@kits/incident-copilot/model-configs/investigate_diagnose.ts`:
- Around line 4-18: The exported config stub in investigate_diagnose.ts does not
match the header comment: it claims temperature 0, but the object has no
temperature field and every property points back to the same file. Update the
object to either include the intended model configuration fields, including
temperature if it should be set here, or revise the comment to explicitly say
the setting is Studio-only; use the exported default object and the header
comment as the places to align.
In `@kits/incident-copilot/README.md`:
- Around line 24-47: The diagram labels in README are using placeholder
parameters and omit the required rankedHypotheses argument, so update the action
callouts to match the real orchestrator signatures: investigate(alertText,
incidentId, repoUrl) and draftComms(hypothesis, evidence, rankedHypotheses,
incidentId). Make the flow diagram and any nearby labels consistent with the
actual action names and parameter order shown by actions/orchestrate.ts,
especially around investigate and draftComms.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Pro
Run ID: e9646722-1745-4c4b-8f96-11ee6bf7c94e
⛔ Files ignored due to path filters (1)
kits/incident-copilot/apps/package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (37)
kits/incident-copilot/.env.examplekits/incident-copilot/.gitignorekits/incident-copilot/README.mdkits/incident-copilot/agent.mdkits/incident-copilot/apps/.env.examplekits/incident-copilot/apps/.gitignorekits/incident-copilot/apps/actions/orchestrate.tskits/incident-copilot/apps/app/globals.csskits/incident-copilot/apps/app/layout.tsxkits/incident-copilot/apps/app/page.tsxkits/incident-copilot/apps/components/comms-panel.tsxkits/incident-copilot/apps/components/hypothesis-card.tsxkits/incident-copilot/apps/components/investigation-timeline.tsxkits/incident-copilot/apps/lib/format.tskits/incident-copilot/apps/lib/lamatic-client.tskits/incident-copilot/apps/lib/types.tskits/incident-copilot/apps/next.config.mjskits/incident-copilot/apps/package.jsonkits/incident-copilot/apps/tsconfig.jsonkits/incident-copilot/assets/demo/example-alert.jsonkits/incident-copilot/assets/demo/runbooks.mdkits/incident-copilot/constitutions/default.mdkits/incident-copilot/flows/draft-comms.tskits/incident-copilot/flows/investigate.tskits/incident-copilot/lamatic.config.tskits/incident-copilot/memory/investigate_memory-add.tskits/incident-copilot/memory/investigate_memory-retrieve.tskits/incident-copilot/model-configs/draft-comms_postmortem.tskits/incident-copilot/model-configs/draft-comms_slack.tskits/incident-copilot/model-configs/investigate_diagnose.tskits/incident-copilot/model-configs/investigate_rag.tskits/incident-copilot/prompts/draft-comms_postmortem_system.mdkits/incident-copilot/prompts/draft-comms_slack_system.mdkits/incident-copilot/prompts/draft-comms_user.mdkits/incident-copilot/prompts/investigate_diagnose_system.mdkits/incident-copilot/prompts/investigate_diagnose_user.mdkits/incident-copilot/prompts/investigate_rag_system.md
| :root { | ||
| --bg: #0b0f17; | ||
| --panel: #131a26; | ||
| --panel-2: #0f1520; | ||
| --border: #232d3f; | ||
| --text: #e6edf6; | ||
| --muted: #8b98ac; | ||
| --accent: #4f8cff; | ||
| --high: #ff5c5c; | ||
| --medium: #ffb23e; | ||
| --low: #6aa1ff; | ||
| --good: #35c98b; | ||
| --radius: 12px; | ||
| } | ||
|
|
||
| * { box-sizing: border-box; } | ||
|
|
||
| html, body { | ||
| margin: 0; | ||
| padding: 0; | ||
| background: var(--bg); | ||
| color: var(--text); | ||
| font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; | ||
| line-height: 1.55; | ||
| } | ||
|
|
||
| a { color: var(--accent); } | ||
|
|
||
| .container { | ||
| max-width: 920px; | ||
| margin: 0 auto; | ||
| padding: 32px 20px 96px; | ||
| } | ||
|
|
||
| .header h1 { margin: 0 0 4px; font-size: 26px; letter-spacing: -0.02em; } | ||
| .header p { margin: 0; color: var(--muted); } | ||
|
|
||
| .panel { | ||
| background: var(--panel); | ||
| border: 1px solid var(--border); | ||
| border-radius: var(--radius); | ||
| padding: 18px; | ||
| margin-top: 18px; | ||
| } | ||
|
|
||
| label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 6px; } | ||
|
|
||
| textarea, input[type="text"] { | ||
| width: 100%; | ||
| background: var(--panel-2); | ||
| border: 1px solid var(--border); | ||
| color: var(--text); | ||
| border-radius: 8px; | ||
| padding: 10px 12px; | ||
| font-size: 14px; | ||
| font-family: inherit; | ||
| resize: vertical; | ||
| } | ||
| textarea:focus, input:focus { outline: 1px solid var(--accent); border-color: var(--accent); } | ||
|
|
||
| .row { display: flex; gap: 12px; flex-wrap: wrap; } | ||
| .row > div { flex: 1; min-width: 200px; } | ||
|
|
||
| .actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; } | ||
|
|
||
| button { | ||
| background: var(--accent); | ||
| color: white; | ||
| border: none; | ||
| border-radius: 8px; | ||
| padding: 10px 16px; | ||
| font-size: 14px; | ||
| font-weight: 600; | ||
| cursor: pointer; | ||
| } | ||
| button.secondary { background: transparent; border: 1px solid var(--border); color: var(--text); } | ||
| button:disabled { opacity: 0.5; cursor: not-allowed; } | ||
|
|
||
| .error { | ||
| border: 1px solid var(--high); | ||
| background: rgba(255, 92, 92, 0.08); | ||
| color: #ffd6d6; | ||
| padding: 12px 14px; | ||
| border-radius: 8px; | ||
| margin-top: 16px; | ||
| font-size: 14px; | ||
| } | ||
|
|
||
| /* Timeline */ | ||
| .timeline { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; } | ||
| .step { | ||
| display: flex; align-items: center; gap: 8px; | ||
| font-size: 13px; color: var(--muted); | ||
| border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; | ||
| } | ||
| .step .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); } | ||
| .step.active .dot { background: var(--accent); animation: pulse 1s infinite; } | ||
| .step.done .dot { background: var(--good); } | ||
| .step.done { color: var(--text); } | ||
| @keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } } | ||
|
|
||
| /* Hypotheses */ | ||
| .summary { color: var(--muted); font-size: 14px; margin: 6px 0 0; } | ||
| .hyp { | ||
| border: 1px solid var(--border); | ||
| border-radius: var(--radius); | ||
| padding: 16px; | ||
| margin-top: 14px; | ||
| background: var(--panel-2); | ||
| } | ||
| .hyp.top { border-color: var(--accent); } | ||
| .hyp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; } | ||
| .hyp-title { margin: 0; font-size: 16px; } | ||
| .rank { color: var(--muted); font-variant-numeric: tabular-nums; } | ||
|
|
||
| .badge { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; } | ||
| .badge-high { background: rgba(255, 92, 92, 0.15); color: var(--high); } | ||
| .badge-medium { background: rgba(255, 178, 62, 0.15); color: var(--medium); } | ||
| .badge-low { background: rgba(106, 161, 255, 0.15); color: var(--low); } | ||
|
|
||
| .reasoning { margin: 10px 0; font-size: 14px; } | ||
| .evidence { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; } | ||
| .evidence h4 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); } | ||
| .evidence ul { margin: 0; padding-left: 18px; font-size: 13px; } | ||
| .evidence .support li::marker { color: var(--good); } | ||
| .evidence .against li::marker { color: var(--high); } | ||
| .nextstep { margin-top: 12px; font-size: 13px; color: var(--text); } | ||
| .nextstep b { color: var(--accent); } | ||
|
|
||
| @media (max-width: 640px) { .evidence { grid-template-columns: 1fr; } } | ||
|
|
||
| /* Comms */ | ||
| .comms { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } | ||
| @media (max-width: 760px) { .comms { grid-template-columns: 1fr; } } | ||
| .comms h3 { margin: 0 0 8px; font-size: 15px; } | ||
| pre.draft { | ||
| white-space: pre-wrap; | ||
| word-break: break-word; | ||
| background: var(--panel-2); | ||
| border: 1px solid var(--border); | ||
| border-radius: 8px; | ||
| padding: 12px; | ||
| font-size: 13px; | ||
| font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; | ||
| margin: 0; | ||
| max-height: 420px; | ||
| overflow: auto; | ||
| } | ||
|
|
||
| .callout { | ||
| border-left: 3px solid var(--medium); | ||
| background: rgba(255, 178, 62, 0.06); | ||
| padding: 8px 12px; margin-top: 10px; border-radius: 6px; | ||
| font-size: 13px; color: var(--muted); | ||
| } | ||
| .muted { color: var(--muted); font-size: 13px; } |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟠 Major | 🏗️ Heavy lift
Your CSS has gone rogue, agent — no Tailwind in sight.
This entire stylesheet is hand-rolled vanilla CSS; there's no Tailwind utility usage, config, or shadcn/ui styling anywhere. As per coding guidelines, kits/*/apps/**/*.{ts,tsx,js,jsx}: "use Next.js 14-15, React 18, TypeScript, Tailwind CSS v4+, shadcn/ui components, react-hook-form + zod for forms, lucide-react for icons, and Vercel for deployment." This file (and the corresponding missing tailwindcss/postcss deps in package.json) confirms the app diverges from the mandated styling stack.
🧰 Tools
🪛 Stylelint (17.14.0)
[error] 1-1: Unknown rule scss/at-rule-no-unknown. Did you mean at-rule-no-unknown?
(scss/at-rule-no-unknown)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@kits/incident-copilot/apps/app/globals.css` around lines 1 - 156, The
stylesheet is still fully custom CSS instead of the required Tailwind/shadcn
styling stack. Replace the handcrafted rules in globals.css with Tailwind v4
base/theme/utilities-driven styles and move component styling to shadcn/ui
patterns used by the app’s React components. Also update the app setup to
include the missing Tailwind/PostCSS dependencies and ensure the layout imports
the global Tailwind stylesheet so the styling system matches the mandated stack.
Source: Coding guidelines
| <div className="against"> | ||
| <h4>Contradicting</h4> | ||
| <ul> | ||
| {h.contradictingEvidence.map((e, i) => ( | ||
| <li key={i}>{e}</li> | ||
| ))} | ||
| </ul> | ||
| </div> |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Agent, the "Contradicting" section has gone dark — no empty-state fallback.
Unlike supportingEvidence (line 21-25), contradictingEvidence has no "None cited." fallback, so an empty array renders a bare, confusing <ul>.
🎯 Proposed fix
<div className="against">
<h4>Contradicting</h4>
<ul>
- {h.contradictingEvidence.map((e, i) => (
- <li key={i}>{e}</li>
- ))}
+ {h.contradictingEvidence.length > 0 ? (
+ h.contradictingEvidence.map((e, i) => <li key={i}>{e}</li>)
+ ) : (
+ <li className="muted">None cited.</li>
+ )}
</ul>
</div>📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| <div className="against"> | |
| <h4>Contradicting</h4> | |
| <ul> | |
| {h.contradictingEvidence.map((e, i) => ( | |
| <li key={i}>{e}</li> | |
| ))} | |
| </ul> | |
| </div> | |
| <div className="against"> | |
| <h4>Contradicting</h4> | |
| <ul> | |
| {h.contradictingEvidence.length > 0 ? ( | |
| h.contradictingEvidence.map((e, i) => <li key={i}>{e}</li>) | |
| ) : ( | |
| <li className="muted">None cited.</li> | |
| )} | |
| </ul> | |
| </div> |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@kits/incident-copilot/apps/components/hypothesis-card.tsx` around lines 28 -
35, The Contradicting section in hypothesis-card.tsx renders an empty <ul> when
hypothesisCard’s contradictingEvidence array has no items, unlike the
supportingEvidence block. Update the HypothesisCard rendering so the
contradiction list has the same empty-state fallback as the supporting section,
showing a clear “None cited.” message when h.contradictingEvidence is empty. Use
the existing h.contradictingEvidence map block and match the conditional
rendering pattern already used for supportingEvidence.
| "scripts": { | ||
| "investigate_parse_repo": "@scripts/investigate_parse-repo.ts", | ||
| "investigate_shape_changes": "@scripts/investigate_shape-changes.ts" | ||
| }, |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
fd . kits/incident-copilot -t d
fd 'investigate_parse-repo|investigate_shape-changes' kits/incident-copilotRepository: Lamatic/AgentKit
Length of output: 550
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Map the kit tree and inspect the investigate flow plus any script-like references.
printf '\n== file tree ==\n'
fd . kits/incident-copilot -t d | sort
printf '\n== files of interest ==\n'
fd . kits/incident-copilot -t f | sort | sed -n '1,200p'
printf '\n== investigate flow outline ==\n'
ast-grep outline kits/incident-copilot/flows/investigate.ts --view expanded || true
printf '\n== investigate flow references ==\n'
rg -n '`@scripts/`|investigate_parse-repo|investigate_shape-changes|codeNode_parse|codeNode_changes' kits/incident-copilot/flows/investigate.tsRepository: Lamatic/AgentKit
Length of output: 3478
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '\n== scripts directories anywhere in repo ==\n'
fd . -t d | rg '(^|/)scripts$|^kits/.+/scripts/$' || true
printf '\n== kit config and aliases ==\n'
cat -n kits/incident-copilot/lamatic.config.ts | sed -n '1,260p'
printf '\n== package/project references to `@scripts` ==\n'
rg -n '`@scripts/`' -g '!**/node_modules/**' -g '!**/dist/**' -g '!**/build/**' .
printf '\n== investigate flow surrounding references ==\n'
sed -n '88,205p' kits/incident-copilot/flows/investigate.tsRepository: Lamatic/AgentKit
Length of output: 50373
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '\n== docs on `@scripts` convention ==\n'
sed -n '130,190p' CLAUDE.md
printf '\n== more docs on `@scripts` convention ==\n'
sed -n '110,145p' CONTRIBUTING.md
printf '\n== incident-copilot README mentions ==\n'
rg -n 'scripts/|`@scripts/`|code node|Lamatic|deploy' kits/incident-copilot/README.md kits/incident-copilot/agent.md kits/incident-copilot/flows/investigate.tsRepository: Lamatic/AgentKit
Length of output: 7515
Add the missing @scripts files for the investigate flow
kits/incident-copilot/flows/investigate.ts:98-99,160,192 points codeNode_parse and codeNode_changes at @scripts/investigate_parse-repo.ts and @scripts/investigate_shape-changes.ts, but there’s no scripts/ directory or matching files in this repo. Those code nodes won’t resolve until the scripts are added or the references are corrected.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@kits/incident-copilot/flows/investigate.ts` around lines 97 - 100, The
investigate flow references missing script modules, so update the flow setup to
point `codeNode_parse` and `codeNode_changes` at valid script locations or add
the missing `@scripts/investigate_parse-repo.ts` and
`@scripts/investigate_shape-changes.ts` files. Check the `investigate` flow
wiring and the related code node references so the script paths resolve
correctly at runtime.
| // Capable chat model at a low temperature (~0.3). The postmortem is a structured | ||
| // skeleton templated tightly off the investigation evidence, so it favours | ||
| // faithful, well-organised output over creative prose. Credentials blanked for | ||
| // sharing; set your own in Lamatic Studio. | ||
|
|
||
| export default { | ||
| "generativeModelName": "@model-configs/draft-comms_postmortem.ts", | ||
| "credentials": "@model-configs/draft-comms_postmortem.ts", | ||
| "memories": "@model-configs/draft-comms_postmortem.ts", | ||
| "messages": "@model-configs/draft-comms_postmortem.ts", | ||
| "attachments": "@model-configs/draft-comms_postmortem.ts" | ||
| }; |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win
Third time's the pattern: postmortem's "~0.3" temperature has no field to back it up.
Consistent with the diagnose and slack configs — the comment sets an expectation the object doesn't fulfill.
🕵️ Suggested clarification
export default {
"generativeModelName": "`@model-configs/draft-comms_postmortem.ts`",
"credentials": "`@model-configs/draft-comms_postmortem.ts`",
+ "temperature": "`@model-configs/draft-comms_postmortem.ts`",
"memories": "`@model-configs/draft-comms_postmortem.ts`",
"messages": "`@model-configs/draft-comms_postmortem.ts`",
"attachments": "`@model-configs/draft-comms_postmortem.ts`"
};📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| // Capable chat model at a low temperature (~0.3). The postmortem is a structured | |
| // skeleton templated tightly off the investigation evidence, so it favours | |
| // faithful, well-organised output over creative prose. Credentials blanked for | |
| // sharing; set your own in Lamatic Studio. | |
| export default { | |
| "generativeModelName": "@model-configs/draft-comms_postmortem.ts", | |
| "credentials": "@model-configs/draft-comms_postmortem.ts", | |
| "memories": "@model-configs/draft-comms_postmortem.ts", | |
| "messages": "@model-configs/draft-comms_postmortem.ts", | |
| "attachments": "@model-configs/draft-comms_postmortem.ts" | |
| }; | |
| // Capable chat model at a low temperature (~0.3). The postmortem is a structured | |
| // skeleton templated tightly off the investigation evidence, so it favours | |
| // faithful, well-organised output over creative prose. Credentials blanked for | |
| // sharing; set your own in Lamatic Studio. | |
| export default { | |
| "generativeModelName": "`@model-configs/draft-comms_postmortem.ts`", | |
| "credentials": "`@model-configs/draft-comms_postmortem.ts`", | |
| "temperature": "`@model-configs/draft-comms_postmortem.ts`", | |
| "memories": "`@model-configs/draft-comms_postmortem.ts`", | |
| "messages": "`@model-configs/draft-comms_postmortem.ts`", | |
| "attachments": "`@model-configs/draft-comms_postmortem.ts`" | |
| }; |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@kits/incident-copilot/model-configs/draft-comms_postmortem.ts` around lines 4
- 15, The draft postmortem config comment mentions a low temperature (~0.3), but
the exported object in draft-comms_postmortem.ts does not include a temperature
setting. Update the default export so the configuration explicitly sets the same
temperature value used by the related diagnose and slack config objects, keeping
the field on the model config object alongside generativeModelName and the other
properties.
| // A capable chat model at a moderate temperature (~0.5) for natural, readable | ||
| // status-update prose. Higher than the diagnose node (which is 0) because this is | ||
| // writing, not ranking — but not so high that it starts embellishing beyond the | ||
| // evidence. Credentials blanked for sharing; set your own in Lamatic Studio. | ||
|
|
||
| export default { | ||
| "generativeModelName": "@model-configs/draft-comms_slack.ts", | ||
| "credentials": "@model-configs/draft-comms_slack.ts", | ||
| "memories": "@model-configs/draft-comms_slack.ts", | ||
| "messages": "@model-configs/draft-comms_slack.ts", | ||
| "attachments": "@model-configs/draft-comms_slack.ts" | ||
| }; |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win
Same briefing gap as the Diagnose config: temperature is described but not encoded.
The comment specifies "~0.5" for natural prose, yet the object exposes no temperature key — just self-referencing stubs.
🕵️ Suggested clarification
export default {
"generativeModelName": "`@model-configs/draft-comms_slack.ts`",
"credentials": "`@model-configs/draft-comms_slack.ts`",
+ "temperature": "`@model-configs/draft-comms_slack.ts`",
"memories": "`@model-configs/draft-comms_slack.ts`",
"messages": "`@model-configs/draft-comms_slack.ts`",
"attachments": "`@model-configs/draft-comms_slack.ts`"
};🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@kits/incident-copilot/model-configs/draft-comms_slack.ts` around lines 4 -
15, The draft-comms Slack model config is missing the temperature setting that
the comment calls for, and the current fields are still self-referencing
placeholders. Update the exported object in draft-comms_slack.ts to include a
temperature value around 0.5, and replace the stubbed credentials, memories,
messages, and attachments entries with the intended real configuration values or
references used by the other model-config files.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
kits/incident-copilot/model-configs/investigate_diagnose.ts (1)
15-21: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueUndercover fields that never get called into action.
Cross-referencing the
investigateflow,InstructorLLMNode_diagnoseonly wiresgenerativeModelNameto@model-configs/investigate_diagnose.ts; itsmemories,messages,attachments, andcredentialsare hardcoded literals ("[]","") rather than referencing this config. Compare this withdraft-comms_slack.ts/draft-comms_postmortem.ts, where all five keys are genuinely wired by their consuming nodes. Here, four of the five exported keys are decoys — dead weight that contradicts the file's own "shareable convention" framing and could mislead whoever edits this file expecting those settings to take effect.Either drop the unused keys to match what the node actually consumes, or (if the intent is to eventually wire them) note that explicitly in the header comment.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@kits/incident-copilot/model-configs/investigate_diagnose.ts` around lines 15 - 21, The exported config in investigate_diagnose.ts includes several fields that are never consumed by the investigate flow, so the file misrepresents what actually takes effect. Update the model config export to only include the settings used by InstructorLLMNode_diagnose, or align the consumer to reference the exported keys consistently like the draft-comms_* configs; if these fields are intentionally placeholders, add that clarification in the header comment so the dead entries in the export are not misleading.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@kits/incident-copilot/model-configs/investigate_diagnose.ts`:
- Around line 15-21: The exported config in investigate_diagnose.ts includes
several fields that are never consumed by the investigate flow, so the file
misrepresents what actually takes effect. Update the model config export to only
include the settings used by InstructorLLMNode_diagnose, or align the consumer
to reference the exported keys consistently like the draft-comms_* configs; if
these fields are intentionally placeholders, add that clarification in the
header comment so the dead entries in the export are not misleading.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Pro
Run ID: 9eef5282-74dd-446a-9495-21c1d2871b50
📒 Files selected for processing (5)
kits/incident-copilot/README.mdkits/incident-copilot/apps/app/page.tsxkits/incident-copilot/model-configs/draft-comms_postmortem.tskits/incident-copilot/model-configs/draft-comms_slack.tskits/incident-copilot/model-configs/investigate_diagnose.ts
|
Hi @Tushar2604! 👋 Before this PR can be reviewed by maintainers, please resolve all comments and requested changes from the CodeRabbit automated review. Steps to follow:
This helps keep the review process efficient for everyone. Thank you! 🙏 |
Incident Copilot — an investigation agent for on-call engineers
Paste a production alert and it does what a good teammate does in the first ten
minutes of an incident: reads the runbooks, checks what shipped recently, and
returns ranked, evidence-grounded root-cause hypotheses — each with the evidence
for and against it and a concrete next step. Feed it new information and it
revises the ranking instead of restarting. When you're ready, it drafts a hedged
Slack update and a blameless postmortem skeleton. It investigates and drafts — it
never acts (no deploys, restarts, or posting).
Companion to
llm-eval-harness: that kit gates generation quality, this one helpsyou diagnose a live incident.
Why it's an agent, not a chatbot
recent commits on the affected repo (a live
apiNodeGitHub call), never a guess.a hard rule, so you get a calibrated ranking, not a confident single answer.
follow-up ("the DB pool is maxed") revises the existing ranking and says what changed.
AgentKit capabilities used (each doing real work)
Runbook_RAGFetch_Commits(apiNode→ GitHub)Retrieve_Prior/Remember, keyed by incident IDDiagnose(InstructorLLMNode+ JSON schema)investigate+draft-commsFlows
investigate{ alertText, incidentId, repoUrl?, githubToken? }{ hypotheses[], summary, insufficientInfo }draft-comms{ hypothesis, evidence, rankedHypotheses, incidentId }{ slackUpdate, postmortem }Verified locally
npx tsc --noEmit→ cleannpm run build→ clean (Next 16 / React 19, 3 routes prerendered)@referencepaths resolve; no.env/secrets committed; only this kit folder touchedTry it
INC-2043).and payment degradation down; each card explains what changed.
Demo
📹
Notes
"recent-changes unavailable"; the investigation continues on runbooks alone.
assets/demo/runbooks.mdfor your team's, no code changes.PR Checklist
Contribution type: Kit (
kits/incident-copilot/) — flat structure per current CONTRIBUTING.md / CLAUDE.md.General
kits/incident-copilot/).env.exampleplaceholders)kebab-caseREADME.mdStructure (current flat format)
lamatic.config.tspresent with validtype,name,author,tags,steps,linksagent.md,README.md,constitutions/default.mdpresentflows/investigate.tsandflows/draft-comms.tspresent; resources externalized via@references.env.exampleat kit root and inapps/with placeholders onlyapps/package.jsonbuilds and runs (npm install && npm run dev)Validation
feat:parse-error:the validation endpoint returned a Vercel Security Checkpoint HTML page instead of a JSON
verdict, so the workflow couldn't parse a status. This looks like endpoint bot-protection
rather than a kit issue (workflow is marked "Phase 2, testing"). Phase 1 structural validation
passed — could a maintainer please re-run Phase 2?
incident-copilotkit with a Next.js app, Lamatic kit config, README/agent docs, constitution, env templates, and demo assets.investigate: a multi-stage incident triage flow usingAPI Requesttrigger, runbookRAG, GitHubapiNodecommit lookup, code nodes to shape repo evidence, memory retrieve/remember nodes for incident-scoped history, anInstructorLLMNodeDiagnose step with structured JSON output, and anAPI Responsenode.draft-comms: a parallel communications flow usingAPI Requesttrigger, two dynamic LLM nodes to draft a Slack update and blameless postmortem skeleton, and anAPI Responsenode.flow.jsonfile was present; the flow structure is defined directly inflows/investigate.tsandflows/draft-comms.ts.