Skip to content

feat(handoff): add host-advisory rollover triggers for long sessions #1787

Open

Description

@AlexStocks

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:

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_reasons such as host_context_budget, host_compaction, and context_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:

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.

Activity

  1. thunguo commented on Sep 30, 2026

    @thunguo
    Collaborator

    plz assign to me.

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions