Repository navigation
feat(handoff): add host-advisory rollover triggers for long sessions #1787
Description
Feature description
Add host-advisory rollover trigger observations for long sessions.
PowerContext already has Handoff as the work-continuity boundary, and PR #1783 proposes/implements advisory rollover_reasons for Handoff preparation. This issue tracks the next step: let host integrations report bounded observations that can suggest or prepare a Rollover Handoff when a session is becoming a poor carrier of current work state.
Codex prior art to review:
- [codex] Add new context window tool openai/codex#27488 -
[codex] Add new context window tool - Allow models to enable token budgeting by default openai/codex#41803 -
Allow models to enable token budgeting by default - Add experimental context management activation openai/codex#42385 -
Add experimental context management activation
The portable idea is not the provider-specific ability to open a new context window. The portable idea is the decision boundary: when the active session is long, budget-constrained, compacted, or low-quality, preserve the work state outside the old context before continuing elsewhere.
Problem and proposed solution
Long agent sessions can accumulate memory rot before they hard-fail on token limits. Hosts may have signals such as:
- approximate token/context budget pressure;
- compaction count or imminent compaction;
- session age or number of tool turns;
- model-reported context quality problems;
- user-requested fresh-session continuation.
PowerContext should accept these as advisory host observations and translate them into a bounded Handoff preparation path, not into agent control.
Proposed behavior:
- Define a host observation shape for context budget, compaction, and context-quality signals.
- Allow host integrations to attach those observations as Source evidence where policy permits.
- Map observations to existing Handoff
rollover_reasonssuch ashost_context_budget,host_compaction, andcontext_quality. - Support manual/advisory/automatic-draft levels, while keeping automatic commit out of scope.
- Keep the flow fail-open: if observations are missing or unsupported, normal Handoff and PreparedContext behavior continues.
Alternatives considered
- Let each host implement rollover heuristics privately. This is easy, but makes behavior hard to explain and impossible to evaluate across hosts.
- Store token-budget observations in Memory. That would pollute durable project memory with session-local telemetry.
- Let PowerContext open or manage agent sessions. That crosses the product boundary; PC should preserve state, not run the agent.
Additional context
Related PowerContext work:
- PR RFC: Handoff session rollover #1783: Handoff session rollover RFC and initial
rollover_reasonsimplementation. - tracking(continuity): 宿主历史导入与可评估的上下文连续性 #1574: host history import and evaluable context continuity.
- Tracking Issue: make PowerContext work continuity reliable, explainable, and cross-host #1352: reliable, explainable, cross-host work continuity.
Acceptance criteria:
- A host can report context-budget/compaction observations without changing committed Handoff content identity.
- The observations can drive Handoff prepare with the appropriate
rollover_reasons. - Unsupported hosts remain compatible and do not need to provide these signals.
- The docs clearly state that observations are untrusted unless backed by authorized Source evidence.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsTodo
Activity
thunguo commentedon Sep 30, 2026
plz assign to me.