Summary
After navigating through the Pi session tree, Downshift can correctly restore a branch's recorded premium phase even when that branch's current context usage is already at or above the configured threshold.
The footer currently renders this state as:
This is technically accurate, but ambiguous. It can look as though Downshift failed to recognize the threshold or failed to switch to economy.
Context
This behavior follows the branch-restoration semantics introduced by #27:
/tree restores the destination branch's recorded premium/economy phase.
- Navigation itself does not evaluate the threshold or generate a handoff.
- The next
context event performs the normal threshold decision.
The issue is therefore the status presentation, not the branch reconciliation behavior.
Observed configuration
Downshift v0.6.2
threshold: 15%
economy: openai-codex/gpt-5.6-luna:high
premium: explicit (openai-codex/gpt-5.6-sol:high)
start on premium: yes
upshift after compaction: yes
handoff note: no
Reproduction
- Configure a percent threshold, for example
15%.
- Navigate with
/tree to a branch whose persisted Downshift phase is premium.
- Ensure the restored branch's context usage is already at or above the threshold.
- Observe the footer immediately after navigation.
Current behavior
The footer displays:
Downshift remains in the restored premium phase until the next normal context evaluation. With handoff disabled, that evaluation then switches directly to economy.
Expected behavior
The footer should distinguish between:
- premium with remaining threshold budget, and
- premium with the threshold already reached.
Suggested wording:
⇣ premium (threshold reached)
For combined token and percent thresholds, the status should remain deterministic and compact while clearly indicating when any configured threshold has been reached.
Proposed implementation
Update statusText() so that when:
- Downshift is enabled,
- the current position is
premium, and
thresholdReached(usage, config.threshold) is true,
it returns an explicit threshold-reached status instead of clamping the remaining value to zero.
The threshold decision and model-switch behavior should remain unchanged.
Non-goals
- Do not evaluate thresholds during
session_tree.
- Do not switch to economy as part of tree navigation.
- Do not change branch phase restoration.
- Do not generate a handoff during passive reconciliation.
- Do not alter threshold comparison semantics.
Acceptance criteria
Test coverage
Add focused statusText() tests for:
- percent threshold below, exactly at, and above the limit,
- token threshold below, exactly at, and above the limit,
- combined thresholds where one threshold has been reached,
- unchanged economy and safety-state output.
Add an adapter-level regression test showing that session_tree may restore premium above threshold, displays the clarified status, sends no handoff, and leaves switching to the next context event.
Summary
After navigating through the Pi session tree, Downshift can correctly restore a branch's recorded
premiumphase even when that branch's current context usage is already at or above the configured threshold.The footer currently renders this state as:
This is technically accurate, but ambiguous. It can look as though Downshift failed to recognize the threshold or failed to switch to economy.
Context
This behavior follows the branch-restoration semantics introduced by #27:
/treerestores the destination branch's recorded premium/economy phase.contextevent performs the normal threshold decision.The issue is therefore the status presentation, not the branch reconciliation behavior.
Observed configuration
Reproduction
15%./treeto a branch whose persisted Downshift phase ispremium.Current behavior
The footer displays:
Downshift remains in the restored premium phase until the next normal
contextevaluation. With handoff disabled, that evaluation then switches directly to economy.Expected behavior
The footer should distinguish between:
Suggested wording:
For combined token and percent thresholds, the status should remain deterministic and compact while clearly indicating when any configured threshold has been reached.
Proposed implementation
Update
statusText()so that when:premium, andthresholdReached(usage, config.threshold)is true,it returns an explicit threshold-reached status instead of clamping the remaining value to zero.
The threshold decision and model-switch behavior should remain unchanged.
Non-goals
session_tree.Acceptance criteria
threshold reachedstatus.Test coverage
Add focused
statusText()tests for:Add an adapter-level regression test showing that
session_treemay restore premium above threshold, displays the clarified status, sends no handoff, and leaves switching to the nextcontextevent.