Skip to content

Scheduled task asks the same confirmation again after Cancel or Confirm #341

Backlog

Description

@funana777

@marcelklehr you built scheduled tasks and the confirmation classification, could you take a look?

Steps to reproduce

  1. Create a scheduled task whose only job needs a tool call that asks for confirmation (seen: a digest that writes a note with upload_file).
  2. Let the confirmation come up while the run is unattended (seen: the classification lookup failed and the call was rated EXTERNAL; fix(impulse): retry a classification hook once on a transient server error #340 retries such lookups).
  3. Press Cancel, or press Confirm while the call keeps failing.

Expected behaviour

A run that cannot do what was denied, or what keeps failing, stops with a clear message ("Stopped: the note could not be written") instead of asking again.

Actual behaviour

Cancel and Confirm both bring the same confirmation back. The only way out is deleting the whole scheduled task.

Why Cancel loops: a Cancel without text sends the model "The user denied the tool call. Continue assisting but do not use the tool call for now." (agent.py). The scheduled task view has no input field, so it always gets this version. A run whose task can only finish with that call has nothing else to do, and the model issues the call again.

Why Confirm loops: the tool runs and fails. The model gets Error: ... please fix your mistakes. (graph.py, handle_tool_error) and issues the call again. route_tools classifies the new call from scratch, the lookup fails again, and the user is asked again.

Proposal

A. Wording first. For a call denied without a reason, tell the model not to try it again in this conversation and to tell the user what it could not do. For a tool error, stop inviting a retry ("please fix your mistakes") when the error is not about the arguments.

B. A guard if A is not enough. Before asking for confirmation, check the conversation since the last user message for the same call (same tool, same arguments) that was already denied or failed. If it's there, answer the pending call with an error ToolMessage and end, instead of interrupting. The call has to be answered first: routing to END with an unanswered tool call breaks the next turn.

Open questions:

  • Only for scheduled tasks, or also in chat? In chat the user can type a new message, so a loop does less harm. context_agent cannot tell the two apart today: the task input has no field for it, so assistant would have to send one.
  • Should "same" ignore small changes in the arguments, such as a different timestamp in the content?

Related: while a confirmation is pending, the scheduled task view has no input field, so the user cannot steer the run (separate assistant issue, not filed yet).

Server configuration

cloud.nextcloud.com, Nov 18 to 19, 2026. Nextcloud version: unknown. Context Agent version: unknown.

Seen on this live instance; not reproduced on a test instance.

Browser

Not applicable (unattended scheduled run).


Assisted by ClaudeCode:claude-opus-5-5


Generated by Claude Code

Activity

  1. added
    bug
    on Nov 24, 2026
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

    0. Needs triagebug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions