mirror of
https://github.com/Twigpine/zero.git
synced 2026-11-09 13:31:26 -10:00
* fix(agent): scope self-reported incompletion to sentences about the current objective
The detector matched inability stems anywhere in the final message, so a
conversational recap of a past exchange ("You asked if I could work
autonomously ... so I couldn't actually do it at the time") downgraded a
completed run to INCOMPLETE. Match per sentence instead, drop quoted spans,
and skip sentences that retell a past exchange. The real transcript is now a
regression test, and genuine admissions still fire, both present tense and
past tense about the current task.
* feat(exec): add --no-completion-gate for conversational callers
A chat frontend driving zero exec has an operator present, so a final
message that hands the turn back ("the sandbox blocks network egress,
approve it and I'll continue") is a complete conversational answer, not an
unfinished task. The headless completion gate still stamped such runs
INCOMPLETE (exit 4) on the honest inability phrasing, and no phrase
heuristic can fix that case because the admission is true. The new flag
maps to RequireCompletionSignal=false so conversational callers can opt
out. Default behavior is unchanged.
* fix(exec): address review findings on quote stripping and --use-spec combination
stripQuoted now removes only balanced quoted spans: an opening delimiter
that never closes is restored verbatim, so a stray quote cannot swallow
the rest of the message and hide a genuine admission from the detector.
Regression tests cover dangling straight, curly, and backtick delimiters.
--no-completion-gate combined with --use-spec is now rejected at parse
time, mirroring the --self-correct check: the spec-draft path never
consults the completion gate, so the flag would be silently ignored.
35 lines
1.3 KiB
Go
35 lines
1.3 KiB
Go
package cli
|
|
|
|
import "testing"
|
|
|
|
// --no-completion-gate exists for conversational exec callers (a chat frontend
|
|
// with an operator present): an honest blocker report that hands the turn back
|
|
// must not be downgraded to INCOMPLETE there. The flag maps to
|
|
// agent.Options.RequireCompletionSignal = false; default keeps the gate on.
|
|
func TestParseExecArgsNoCompletionGate(t *testing.T) {
|
|
options, _, err := parseExecArgs([]string{"--prompt", "hi", "--no-completion-gate"})
|
|
if err != nil {
|
|
t.Fatalf("parseExecArgs: %v", err)
|
|
}
|
|
if !options.noCompletionGate {
|
|
t.Fatal("--no-completion-gate must set noCompletionGate")
|
|
}
|
|
|
|
options, _, err = parseExecArgs([]string{"--prompt", "hi"})
|
|
if err != nil {
|
|
t.Fatalf("parseExecArgs: %v", err)
|
|
}
|
|
if options.noCompletionGate {
|
|
t.Fatal("noCompletionGate must default to false (gate on)")
|
|
}
|
|
}
|
|
|
|
// The spec-draft path never consults the completion gate, so the combination
|
|
// must be rejected up front instead of silently ignoring the flag (mirrors the
|
|
// existing --self-correct + --use-spec check).
|
|
func TestParseExecArgsNoCompletionGateRejectsUseSpec(t *testing.T) {
|
|
if _, _, err := parseExecArgs([]string{"--prompt", "hi", "--use-spec", "--no-completion-gate"}); err == nil {
|
|
t.Fatal("--no-completion-gate with --use-spec must error")
|
|
}
|
|
}
|