Skip to content

contextTier setting in settings.json is persisted but not applied on session start (defaults to 200k) #3527

@willc121

Description

@willc121

Describe the bug

The contextTier setting in ~/.copilot/settings.json is persisted by the CLI but is not applied at session start. As a result, fresh sessions default to the 200k context window even when the user has explicitly opted in to the long-context tier via /model.

The model setting (model) and reasoning effort (effortLevel) from settings.json ARE applied on session start. Only contextTier silently gets dropped.

Affected version

GitHub Copilot CLI 1.0.55-1

Steps to reproduce the behavior

  1. Open copilot and run /model. Select a model that supports a long-context tier (in my case Claude Opus 4.7 (1M context)(Internal only)) and choose the long-context option.
  2. Confirm ~/.copilot/settings.json now contains:
    {
      "model": "claude-opus-4.7-1m-internal",
      "contextTier": "long_context"
    }
  3. Exit the CLI (or run /restart).
  4. Start a new session and run /context.

Expected behavior

The new session honors the persisted contextTier: "long_context" setting and starts with the 1M token context window.

Actual behavior

The new session starts with the default 200k context window. The session.model_change event written at session start in ~/.copilot/session-state/<id>/events.jsonl looks like:

{"type":"session.model_change","data":{"newModel":"claude-opus-4.7-1m-internal"}}

Note the absence of contextTier. The model is applied from settings.json but the persisted context tier is not.

To get the long-context window back, I have to re-run /model and reselect the long-context tier every single session, which then emits a session.model_change event WITH contextTier: "long_context" and works correctly for that session only.

Additional context

  • The CLI binary contains code paths that:
    • Write contextTier correctly to settings.json from /model: Rt.contextTier = lt === "long_context" ? "long_context" : void 0
    • Apply contextTier when a model change event includes it: "contextTier" in e.data && (this.contextTier = e.data.contextTier ?? void 0)
  • But the session-start path that applies the persisted model field to the new session does not appear to include the persisted contextTier. Looks like the load-and-apply step at session start needs to read contextTier from settings.json and forward it into the initial session.model_change event (or equivalent).
  • OS: macOS (Darwin, ARM)
  • Shell: zsh
  • Terminal: Terminal.app
  • I confirmed this against three fresh sessions created today (after a CLI restart). All three emitted session.model_change events with the model but no contextTier.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:configurationConfig files, instruction files, settings, and environment variablesarea:context-memoryContext window, memory, compaction, checkpoints, and instruction loadingarea:modelsModel selection, availability, switching, rate limits, and model-specific behavior

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions