Skip to content

feat: decline tool approvals with an instruction - #334

Merged
AetherAI3 merged 1 commit into
mainfrom
feat/issue-326-denial-feedback
Oct 9, 2026
Merged

AetherAI3 merged 1 commit into
mainfrom
feat/issue-326-denial-feedback

Conversation

@AetherAI3

Copy link
Copy Markdown
Owner

Summary

  • Carry a typed approval verdict bound to the original tool-call ID, with an optional 512-byte denial instruction in that call's failed result.
  • Give declined interactive approvals a separate, short-lived input buffer; preserve the composer draft and queued input, and keep automatic/non-TTY decisions unchanged.
  • Suppress duplicate call IDs in both host loops and keep the instruction out of generic refusal metadata.

Evidence

  • npm run build — passed.
  • npm run docs:check — passed (6 generated documentation outputs).
  • 126 focused tests passed across approval feedback, local/hosted tool results, composer ownership, queue behavior, skill host loop, and failure budgets.
  • git diff --cached --check — passed before commit.
  • Fixtures prove denied executors never run, local and hosted results carry the same call ID and instruction, duplicate IDs deliver once, cancellation and paste limits release the input lease, and existing draft/queue behavior remains intact.

Closes #326

@AetherAI3
AetherAI3 merged commit 50c3c06 into main Oct 9, 2026
1 of 8 checks passed
@AetherAI3
AetherAI3 deleted the feat/issue-326-denial-feedback branch October 9, 2026 16:17
@ability-spec

Copy link
Copy Markdown

I reviewed the changes introduced by this PR and reproduced two issues on commit e03aabc using local fixtures and mocked model responses.

@ability-spec ability-spec left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two issues reproduced locally on commit e03aabc using mocked model responses:

[P1] Reused Ollama tool-call IDs stall multi-step runs

In src/commands/code.ts and src/commands/chat.ts, seenCallIds spans the entire run. However, Ollama normalization and text recovery can generate call-1 independently for each model reply.

With successive replies requesting read_file(a.txt) and read_file(b.txt), both calls receive call-1. The second call is skipped without delivering a result, leaving OllamaBrain waiting until cancellation or timeout.

Reproduced through hostLoop: only a.txt was read. Disabling the duplicate-ID check allowed both reads and successful completion.

Please generate run-unique call IDs in the Ollama adapter and preserve consistent result correlation. Add a regression test covering repeated response-local IDs across successive replies.

[P2] Split paste delimiters prematurely submit denial feedback

In src/ui/approval_feedback.ts, splitKeys processes stdin chunks independently. A bracketed-paste opener split into "\x1b[20" and "0~..." is not recognized.

A newline inside the pasted note then submits feedback without an explicit Enter, and returnTail forwards the remaining pasted text to the next input handler.

Reproduced: feedback resolved as "200~Use offline tests", with the second pasted line forwarded to the next handler.

Please buffer incomplete escape sequences across chunks and test split paste delimiters.

Build and 43 selected existing tests passed despite these reproductions.

@AetherAI3

Copy link
Copy Markdown
Owner Author

Thanks @ability-spec for the clear reproductions and review. Both issues are fixed in #337, now merged: Ollama tool calls get unique IDs across replies with matching result correlation, and denial feedback buffers split bracketed-paste markers. I added regressions for the host loop and pasted feedback; the local build and 50 focused tests passed.

GitHub Actions did not start the PR jobs because of an account billing lock, so I merged with the admin override after local verification.

@ability-spec

Copy link
Copy Markdown

Awesome project! I will keep eye on it

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature] Approvals: decline a tool call with an instruction

2 participants