feat(mcp): knowledge fact import + session snapshot in flare_handoff - #269
Conversation
|
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 (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThe MCP handoff request now accepts optional facts and session snapshot fields. Facts are imported into recipient memory on a best-effort basis, while snapshot fields are stored in attachment metadata and documented in the tool description. ChangesHandoff session context enrichment
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Caller
participant handoff_impl
participant handle_remember
participant Attachment
Caller->>handoff_impl: HandoffRequest with facts and snapshot fields
handoff_impl->>handle_remember: RememberInput for each fact
handle_remember-->>handoff_impl: Memory write result
handoff_impl->>Attachment: Store session snapshot in meta
handoff_impl-->>Caller: Handoff outcome
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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/mcp_server.rs`:
- Line 412: Update the public handoff description assigned to the tool around
the facts payload to document the optional topic_key field alongside title,
content, and type. Keep the existing description and behavior unchanged while
making the advertised facts contract match the request schema and handler.
In `@src/mcp_server/handoff.rs`:
- Around line 46-79: Move the knowledge-fact import block around the visible
handoff success path so it runs only after with_backend_db successfully resolves
the item and creates the asset. Preserve the existing best-effort
handle_remember behavior and error logging, while ensuring any backend or
storage failure returns before facts are persisted.
- Around line 62-72: Update the handoff memory flow around RememberInput so
imported facts are associated with the handoff recipient by passing the
appropriate recipient-specific session, project, scope, or agent context through
the memory API. Ensure the recipient value is propagated into the memory layer
rather than leaving all context fields unset; alternatively, revise the handoff
contract and documentation to explicitly define these facts as shared memory.
🪄 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: d38aa94f-1df9-473e-b3e1-619bcc49b2fa
📒 Files selected for processing (3)
src/mcp_server.rssrc/mcp_server/handoff.rssrc/mcp_server/types.rs
Recovers work from item #218 that never landed anywhere reachable — it was sitting uncommitted in a stash from a prior session (correctly kept off master, but never given a branch). Reviewed per item #220, one bug fixed.
Changes
HandoffRequest(types.rs) gains 6 optional fields:facts,summary,findings,decisions,files_touched,evidence.handoff.rs:factsbefore backend work, callshandle_rememberfor each, titles prefixed[sender]. Best-effort — logs and continues on error, never fails the handoff.metaJSON so the recipient gets context from the attachment without extra round-trips.Review fix
HandoffRequest.facts's#[schemars(description = ...)]was copy-pasted from the unrelatedmemorytool's action-enum text ("Single consolidated tool withactionfield (compact|context|curate|...)") — would've leaked a nonsensical description into the MCP tool schema shown to callers. Replaced with an accurate description and added thetopic_key?sub-field the code reads but the old text omitted.Verification
cargo build— cleancargo fmt --check— cleancargo clippy -D warnings— clean (only pre-existing unrelatedclaude_settingsdead_code)cargo test --workspace --lib --bins— all green, incl. 16 handoff testsE0460inskill-registry; not touched by this changeCloses item #220.
Summary by CodeRabbit