Skip to content

Commit 1e522d7

Browse files
committed
fix(cli): show follow-up suggestions for legacy/unknown interaction modes
The suggestions gate only matched the literal strings engaging/enhance, but the loop treats every mode except off/verbose as engaging - so configs with a legacy or invalid interaction_mode (e.g. "all", which some configs carry from the tool_progress domain) silently suppressed the block while otherwise behaving as engaging. Gate on exclusion (only verbose/off suppress), matching the loop's interpretation.
1 parent 69d45f4 commit 1e522d7

2 files changed

Lines changed: 17 additions & 3 deletions

File tree

cmd/odek/proactive.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,15 @@ const maxFollowUpSuggestions = 3
6262

6363
// printFollowUpSuggestions prints a compact block of follow-up suggestions
6464
// after a completed turn. Presentation-only: the block is written to w
65-
// (never appended to the agent response), and only in engaging/enhance
66-
// interaction modes — verbose and off stay machine-clean.
65+
// (never appended to the agent response), and suppressed only in verbose and
66+
// off modes, which stay machine-clean. Anything else — including empty,
67+
// unknown, or legacy mode strings — behaves like engaging, matching the
68+
// loop's own default-engaging interpretation (internal/loop).
6769
func printFollowUpSuggestions(w io.Writer, mm followUpSuggester, interactionMode string) {
6870
if mm == nil {
6971
return
7072
}
71-
if interactionMode != "engaging" && interactionMode != "enhance" {
73+
if interactionMode == "verbose" || interactionMode == "off" {
7274
return
7375
}
7476
fmt.Fprint(w, formatFollowUpSuggestions(mm.FollowUpSuggestions()))

cmd/odek/proactive_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,18 @@ func TestPrintFollowUpSuggestions(t *testing.T) {
7575
}
7676
})
7777

78+
t.Run("printed in unknown/legacy mode", func(t *testing.T) {
79+
// Unknown or legacy mode strings (e.g. "all", "") behave like
80+
// engaging, matching the loop's default-engaging interpretation.
81+
for _, mode := range []string{"all", "", "something-else"} {
82+
var buf bytes.Buffer
83+
printFollowUpSuggestions(&buf, &fakeSuggester{suggestions: sugs}, mode)
84+
if buf.Len() == 0 {
85+
t.Errorf("expected suggestion block in mode %q", mode)
86+
}
87+
}
88+
})
89+
7890
t.Run("suppressed in off mode", func(t *testing.T) {
7991
var buf bytes.Buffer
8092
fs := &fakeSuggester{suggestions: sugs}

0 commit comments

Comments
 (0)