Repository navigation
fix: restore explain pack guidance compatibility - #351
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThis PR fixes a regression where explain pack outputs stopped populating ChangesGuidance fields regression fix
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@src/infrastructure/context-pack-command.ts`:
- Around line 1088-1091: The call to buildExplainPackPayloadCore(...) is added
unconditionally into the object passed to buildPackSchemaV1, causing non-explain
tasks to receive explain-only fields; change the object construction in
renderContextPackOutput / buildPackSchemaV1 call so that you only spread
...buildExplainPackPayloadCore(...) when resolvedTask.task_kind indicates an
explain request (e.g., resolvedTask.task_kind === 'explain'), otherwise omit
that spread (use a conditional spread or build via packForSchema to gate
explain-specific fields); keep the rest of the properties (baseResponse(...),
dependencies.compactRetrieveResult(retrieval), retrieval, implementation)
untouched.
In `@tests/unit/pack-quality-fixtures.test.ts`:
- Around line 103-107: The test currently only compares
payload.pack?.confidence_score with payload.confidence_score which can both be
undefined and hide regressions; update the assertions to explicitly assert the
top-level and nested confidence_score are present and in the expected numeric
range (e.g., defined, not null, and between 0 and 1 or whatever domain your app
expects) before comparing them—locate the assertions referencing
payload.pack?.confidence_score and payload.confidence_score and add explicit
existence and range checks (e.g., expect(...).toBeDefined()/not.toBeNull() and
expect(...).toBeGreaterThanOrEqual(...)/toBeLessThanOrEqual(...)) prior to the
equality assertion.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 96ac42ae-1af3-4e8b-94bc-499e68f3f1ed
📒 Files selected for processing (3)
src/infrastructure/compare.tssrc/infrastructure/context-pack-command.tstests/unit/pack-quality-fixtures.test.ts
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Summary
packfor runtime consumers that still read that shapemadar packandmadar compareso they stay alignedCloses #350
Summary by CodeRabbit