Skip to content

task_complete not written to output causes loss of actual result #2482

Done

Description

@lorenz-mcroonenbroeck

Describe the bug

Regression/Related: #1324

copilot -p "some task e.g. review" --autopilot --model "claude-opus-4.6" Sometimes has no meaningful output (e.g. Agent says it has everything to output a review but nothing is "written" to the output)

if you call copilot -p "continue" --continue --autopilot --model "claude-opus-4.6" it will tell you that the result is already in the task_complete and therefore it is done and has nothing further to do.

if you use --excluded-tools task_complete the agent will not terminate and tries to "search" for a way to terminate since everything is already done. Workaround: set --max-autopilot-continues to something low e.g. 3. But you still don't have access to the content of the task_completed result.

Affected version

1.0.14

Steps to reproduce the behavior

copilot -p "some task e.g. review" --autopilot --model "claude-opus-4.6" happens roughly in 1 of 10 tries.

Expected behavior

The task_completed output is written to STDOUT

Additional context

Workaround: add a task_completed hook to get the content. But since the agent sometimes outputs to STDOUT and sometimes via task_completed it requires some logic the fetch tp correct output.

Activity

  1. added
    area:non-interactiveNon-interactive mode (-p), CI/CD, ACP protocol, and headless automation
    area:agentsSub-agents, fleet, autopilot, plan mode, background agents, and custom agents
    on Apr 16, 2026
  2. qoli commented on Apr 18, 2026

    @qoli

    GitHub Copilot CLI 1.0.32 still this.

  3. qoli commented on Apr 18, 2026

    @qoli

    I ended up using a fairly roundabout workaround.

    I wrapped the GitHub Copilot CLI run inside tmux, then:

    Practical conclusion:
    Monitor events.jsonl.
    As soon as a newly appended line contains "type":"session.task_complete", start a 30-second countdown.
    If the session still does not exit naturally within those 30 seconds, run tmux kill-session.

    我用了一個很曲折的解決辦法。
    用 tmux 把 GitHub Copilot CLI 的運行包裝起來,
    然後,

    實務結論:
    監控 events.jsonl
    一旦看到最新追加了一行 "type":"session.task_complete"
    開始倒數 30 秒
    若 30 秒內沒自然退出,就 tmux kill-session

    Image
  4. geoidesic commented on Oct 27, 2026

    @geoidesic

    This is a deal-breaker for me. I will be ending my subscription. This tool should be banned entirely.

  5. copilot-cli-bot commented on Nov 23, 2026

    @copilot-cli-bot

    This appears to be resolved as of GitHub Copilot CLI v1.0.114. Please update to that release or a newer stable version. We're closing this as completed. If it still happens, please comment with your version and reproduction steps.

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:agentsSub-agents, fleet, autopilot, plan mode, background agents, and custom agentsarea:non-interactiveNon-interactive mode (-p), CI/CD, ACP protocol, and headless automation

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions