Skip to content

feat: Context reset with structured handoff artifacts for long-running sessions#909

Draft
ryaneggz wants to merge 1 commit intodevelopmentfrom
feat/context-reset-handoff
Draft

feat: Context reset with structured handoff artifacts for long-running sessions#909
ryaneggz wants to merge 1 commit intodevelopmentfrom
feat/context-reset-handoff

Conversation

@ryaneggz
Copy link
Copy Markdown
Collaborator

Summary

  • Adds spec and implementation plan for context reset with structured handoff artifacts
  • Introduces ContextResetMiddleware that monitors context utilization and triggers clean resets when threshold is exceeded
  • Defines HandoffArtifact schema for structured session state transfer between agent instances
  • Configurable per assistant via context_strategy: compact | reset | auto
  • Frontend UX: session dividers, expandable handoff summaries, session navigator

Closes #906

Implementation Plan

See .claude/plans/context-reset-handoff.md for full phased implementation plan with acceptance criteria.

Phases

  1. Backend Schema & Middleware Core — HandoffArtifact schema, ContextResetMiddleware, context_strategy field
  2. Session Tracking & Thread Metadata — Session boundaries in thread model, API endpoints
  3. Frontend UX — SessionDivider, HandoffSummary components, session navigator
  4. Planner/Evaluator Integration — Plan persistence, evaluator config carry-forward
  5. Testing — Unit + integration tests for backend, component tests for frontend

Test plan

  • Unit test: HandoffArtifact schema validation (required fields, optional fields, validation errors)
  • Unit test: Middleware triggers at configurable threshold
  • Unit test: Auto strategy selects correct approach based on model name
  • Integration test: Agent completes multi-step task across 2+ context resets
  • Integration test: Files and plan persist through resets
  • Frontend test: SessionDivider renders at correct positions
  • Frontend test: HandoffSummary expand/collapse behavior

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: ryaneggz <kre8mymedia@gmail.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 25, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d5545b0c-5d4b-4e48-a215-6c58b00d2e5c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/context-reset-handoff

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Context reset with structured handoff artifacts for long-running sessions

1 participant