copilot-cli icon indicating copy to clipboard operation
copilot-cli copied to clipboard

task_complete tool unavailable after switching back to autopilot mode

Open AlexMalfr opened this issue 4 months ago • 4 comments

Describe the bug

This appears to be a regression of https://github.com/github/copilot-cli/issues/1523.

That issue was closed after a maintainer stated that, as of v1.0.4:

The task_complete tool is now always available in autopilot mode and can no longer be filtered out.

However, I'm on Copilot CLI 1.0.71 and my session logs show a system prompt stating that the task_complete tool is not available after switching to autopilot mode.

Image

It says in French: I cannot call task_complete in this session because the tool is unavailable. This occurs 3 times in a row after finishing the request (and also earlier in the conversation the day before)


This loop appears to have been actually deducted Copilot Premium Requests from my quota. I'm still on request-based billing because I'm on a legacy annual Copilot Pro+ plan and have not migrated to usage-based billing yet.

Image

On 2026-07-17, my only Copilot usage was this Copilot CLI session (continued from the previous day). My billing usage dashboard recorded 24 premium requests.

For GPT-5.4, one request costs 6 premium requests on my plan. The event log for that date contains:

  • one real user-initiated GPT-5.4 request
  • three subsequent user-message events with "isAutopilotContinuation": true

Affected version

GitHub Copilot CLI 1.0.71.

Steps to reproduce the behavior

Session logs excerpt available below

The relevant chronology in one long-lived session is:

  1. The session starts in interactive mode with GPT-5.4

  2. The mode changes interactive → plan → autopilot

  3. In this first autopilot phase, task_complete is available and is successfully called:

    • an assistant.message requests the task_complete tool
    • tool.execution_start records the call
    • tool.execution_complete records success: true
    • session.task_complete records success: true
  4. The mode changes autopilot → interactive

  5. On the next real user message, the transformed prompt contains:

    <tools_changed_notice>
    Tools no longer available: task_complete
    Important: Do not attempt to call tools that are no longer available unless you've been notified that they're available again.
    </tools_changed_notice>
    
  6. The mode then changes interactive → plan → autopilot.

  7. The new autopilot system prompt still contains the full task_complete tool instructions and says that the agent must call it to finish.

  8. Once the requested work and all todos are complete, Copilot injects an automatic continuation saying:

    You have not yet marked the task as complete using the task_complete tool.
    
  9. The assistant repeatedly states that the task is complete but that task_complete is not available in the session.

  10. Autopilot nevertheless starts another turn and displays Continuing autonomously (1 premium request) each time.

The runtime therefore appears to remove task_complete when returning to interactive mode, while the autopilot controller and system prompt still treat that tool as the mandatory completion mechanism after switching back to autopilot.

Expected behavior

The task_complete tool should be available to the model, no matter what mode it is in.

Additional context

  • GitHub Copilot CLI: 1.0.71
  • Session ID: bff63182-c992-4f71-a211-71d282b8b969
  • Model: GPT-5.4
  • Reasoning effort: high
  • OS: Windows 11 Pro 25H2 26220.7271
  • Architecture: x64
  • Terminal: Windows Terminal
  • Shell: PowerShell 5.1.26100.7271
  • Billing model: legacy request-based billing (legacy annual Copilot Pro+ subscription)

Session logs (event.jsonl) shortened and redacted by ChatGPT to remove my prompts and irrelevant info: copilot-cli-task-complete-redacted.log

AlexMalfr avatar Jul 17 '26 13:07 AlexMalfr

Reproduced on GitHub Copilot CLI 1.0.74-1, so this regression is still present after 1.0.71.

Additional chronology from this occurrence:

  1. An autopilot task completed and task_complete was available. The tool was called successfully twice and returned success.
  2. On a later interactive turn, the runtime injected a tools_changed_notice stating that task_complete was no longer available and must not be called.
  3. The task-completion controller nevertheless repeatedly injected: You have not yet marked the task as complete using the task_complete tool.
  4. All tracked todos were already done, but each assistant response caused another automatic continuation with the same reminder. The model correctly refused to call the removed tool, so the session could not reach the controller's required terminal state.
  5. The user had to interrupt/restart the session to stop the loop.

This confirms both sides of the state mismatch: the runtime removes the tool after it has already succeeded, while the completion controller loses or ignores that success and continues requiring the now-unavailable tool.

Environment: GPT-5.6 Sol, WSL2 Linux x86_64, bash. No repository content or credentials are involved.

udsmicrosoft avatar Jul 22 '26 19:07 udsmicrosoft

الغاء اشترك في sio

في الأربعاء، ٢٢ يوليو ٢٠٢٦، ١٠:٣٦ م udsmicrosoft @.***> كتب:

udsmicrosoft left a comment (github/copilot-cli#4161) https://github.com/github/copilot-cli/issues/4161#issuecomment-5050605889

Reproduced on GitHub Copilot CLI 1.0.74-1, so this regression is still present after 1.0.71.

Additional chronology from this occurrence:

  1. An autopilot task completed and task_complete was available. The tool was called successfully twice and returned success.
  2. On a later interactive turn, the runtime injected a tools_changed_notice stating that task_complete was no longer available and must not be called.
  3. The task-completion controller nevertheless repeatedly injected: You have not yet marked the task as complete using the task_complete tool.
  4. All tracked todos were already done, but each assistant response caused another automatic continuation with the same reminder. The model correctly refused to call the removed tool, so the session could not reach the controller's required terminal state.
  5. The user had to interrupt/restart the session to stop the loop.

This confirms both sides of the state mismatch: the runtime removes the tool after it has already succeeded, while the completion controller loses or ignores that success and continues requiring the now-unavailable tool.

Environment: GPT-5.6 Sol, WSL2 Linux x86_64, bash. No repository content or credentials are involved.

— Reply to this email directly, view it on GitHub https://github.com/github/copilot-cli/issues/4161?email_source=notifications&email_token=CJDXT5MWVYSBWNMBDMPC4435GEJTTA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKMBVGA3DANJYHA42M4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOSWGM33PORSXEX3DNRUWG2Y#issuecomment-5050605889, or unsubscribe https://github.com/notifications/unsubscribe-auth/CJDXT5LKTP4HLHKZSGYI2ZL5GEJTTAVCNFSNUABFKJSXA33TNF2G64TZHM2TQNJYGYYDMNRUHNEXG43VMU5TIOJRGE4DCNBVGU3KC5QC . Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS https://github.com/notifications/mobile/ios/CJDXT5MD7OYMIAC4XKAYEXT5GEJTTA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKMBVGA3DANJYHA42M4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOSVGM33PORSXEX3JN5ZQ and Android https://github.com/notifications/mobile/android/CJDXT5KGFA23N4WWK3FMF4D5GEJTTA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKMBVGA3DANJYHA42M4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOSXGM33PORSXEX3BNZSHE33JMQ. Download it today! You are receiving this because you are subscribed to this thread.Message ID: @.***>

anahagaer877-coder avatar Jul 22 '26 19:07 anahagaer877-coder

This is fixed now in the codebase. I will update this issue with the version number of the new release soon.

szabta89 avatar Jul 28 '26 12:07 szabta89

Version 1.0.76 introduces the fix. Please create a new issue if you still see problems.

szabta89 avatar Jul 31 '26 10:07 szabta89