Skip to content

Context data not available in non-interactive mode #979

Closed as not planned
Closed as not planned

Description

@redsquare

As per the title, why is this?

Activity

  1. agoncal commented on Jan 26, 2026

    @agoncal

    Are you talking about having context available through prompts ? Or adding external file to the context ?

    To keep the context through prompts, you can use the --continue flag:

    $ copilot -p "My favourite colour is blue"
    $ copilot -p "What's my favourite colour ?"
    I dont know what is your favourite colour
    
    $ copilot -p "My favourite colour is blue" --continue
    $ copilot -p "What's my favourite colour ?" --continue
    Blue

    To add an external file to the prompt, you can use @:

    $ copilot -p "Check @pom.xml and give me the dependencies"

    I'm using copilot 0.0.394

  2. redsquare commented on Jan 26, 2026

    @redsquare
    Author

    Apologies, I was coding up Ralph wiggum and wanted to see context window stats. I am afk but can grab more detail when back

  3. redsquare commented on Jan 26, 2026

    @redsquare
    Author

    Apologies, I was coding up Ralph wiggum and wanted to see context window stats. I am afk but can grab more detail when back

  4. added
    area:non-interactiveNon-interactive mode (-p), CI/CD, ACP protocol, and headless automation
    on Apr 6, 2026
  5. added
    area:context-memoryContext window, memory, compaction, checkpoints, and instruction loading
    on Apr 6, 2026
  6. patniko commented on Oct 26, 2026

    @patniko
    Collaborator

    Thanks for following up, and sorry this sat for so long. We couldn't act on this without knowing exactly which data you need, but if it's context-window and token stats, there are now a few options: in prompt mode, --output-format json emits JSONL output for programmatic use (v0.0.422) and --usage-output-file writes usage metrics as JSON (per-agent metrics added in v1.0.81), and if you drive Copilot from code, the Copilot SDK emits session.usage_info events with currentTokens and tokenLimit (docs). If those don't cover your use case, please open a new issue describing the data you need in non-interactive mode, the command you're running, and your CLI version.

    Triaged as part of a Copilot SDK backlog review, with help from GitHub Copilot.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:context-memoryContext window, memory, compaction, checkpoints, and instruction loadingarea:non-interactiveNon-interactive mode (-p), CI/CD, ACP protocol, and headless automation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions