Repository navigation
Conversation
The top-level job observable never receives progress entries; its outcome is written by the job-result finalizer. MakeLastProgressCompletion therefore logged "Observable completed without any progress" at error level on every successful chat, which reads like a failure when diagnosing a stuck agent. Mark such an observable completed (keeping an existing completion) and log at debug level. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PHcZ8CTpZEoK3qgroNnkB4 Signed-off-by: Stefan Walcz <stefan.walcz@walcz.de>
When the model calls the stop action, the tool callback rejects the call (Approved=false). cogito reports any rejection as ErrToolCallCallbackInterrupted, and the check after ExecuteTools only exempts ErrNoToolSelected and ErrGoalNotAchieved, so the run finished with "interrupted via ToolCallCallback" and the stop handling below (lastToolCallName == stop) was never reached. Chat clients showed an error for an agent that simply stopped. Mark the job as settled by the callback in the stop case, like send_message already does, so the interrupt is not treated as a failure. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PHcZ8CTpZEoK3qgroNnkB4 Signed-off-by: Stefan Walcz <stefan.walcz@walcz.de>
When the model chooses the stop action in a job a user is waiting on (a chat
message, UserRole), the job finished with an empty response: stop only ends the
run, nothing produces the answer. Chat clients received nothing — before the
stop fix an "interrupted" error, after it an empty reply. Observed with local
models that pick stop when they decide the request is out of scope or that
they cannot do it ("no suitable template, so I will not draft"), instead of
saying so.
In a user job, a stop now leads to one closing request without tools: the
stop call is dropped from the conversation and the model is asked for its
final plain-text reply (the answer, or briefly why it cannot help). That reply
goes through the required-tool gate like any text finalization; if the model
stops again when asked to run the required tool, the answer it already gave
is kept (same as after the attempt cap). Autonomous runs (SystemRole) still
end silently on stop.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PHcZ8CTpZEoK3qgroNnkB4
Signed-off-by: Stefan Walcz <stefan.walcz@walcz.de>
…ol gate When the required-tool gate gives up after its attempt cap, the answer leaves the agent ungated and only a warning is logged. The user receiving it cannot tell a validated answer from one that skipped the required step (e.g. a fact-validation tool). Add WithRequiredToolBypassNotice(text) and the agent config field required_tool_bypass_notice (with form metadata). When set, the text is appended to the answer exactly when it is finalized ungated -- on the send_message path and on the text finalization path, which also covers the closing reply after a stop in a chat job. No notice when the required tool passed, when the gate is off, or when the option is empty (default: today's log-only behaviour). Specs: bypass after the cap appends the notice (text, send_message, closing reply after stop); passed tool and empty option leave the answer untouched; the notice is never appended twice; config JSON round-trip and form field. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PHcZ8CTpZEoK3qgroNnkB4 Signed-off-by: Stefan Walcz <stefan.walcz@walcz.de>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The required-tool gate (#495) lets an answer through after its attempt cap so a stubborn model cannot hang a turn. That is sensible, but the only trace is a log line (
required-tool gate: bypass after max attempts, answer finalized ungated). Whoever receives the answer cannot tell a validated answer from one that skipped the required step — which defeats the purpose when the required tool is a fact or policy check.We hit this in practice: with a fact-validation tool required, a local model twice ignored the nudge and both answers went out unmarked.
This adds an opt-in notice:
WithRequiredToolBypassNotice(text)and agent config fieldrequired_tool_bypass_notice(with form metadata next to the other required-tool fields).stopin a chat job (fix(agent): a deliberate stop no longer ends the job as a failure; quiet progress-less observables #502).Tests
core/agent/required_tool_bypass_notice_test.go: bypass after the cap appends the notice (text, send_message, closing reply after stop) — red without the change; passed tool and empty option leave the answer untouched; helper does not double-append.core/state/config_bypass_notice_test.go: JSON round-trip and form field.go test ./core/agent/(excluding the two model-backedAgent testcontainers) 74/74,./core/state/green,go vetclean.🤖 Generated with Claude Code
https://claude.ai/code/session_01PHcZ8CTpZEoK3qgroNnkB4
🤖 Generated with Claude Code
https://claude.ai/code/session_01PHcZ8CTpZEoK3qgroNnkB4