Skip to content

Commit e850404

Browse files
committed
feat: add InteractionMode (engaging|verbose) with Narrator for emoji-rich tool progress
- Add InteractionMode config field (file, env, CLI) defaulting to 'engaging' - New internal/narrate package: template-based tool narration with emojis - Integrate narrator into ReAct loop engine (loop.go) - Add NarratorMessage() to Renderer for terminal output - Wire narrator into NewAgent() based on interaction_mode - Telegram: skip raw tool trace in engaging mode, send progress instead - WebUI (serve.go): pass InteractionMode to agent config - REPL: pass InteractionMode via flags - Update /mode command to document the new mode
1 parent 3c7faa0 commit e850404

14 files changed

Lines changed: 877 additions & 90 deletions

File tree

build-and-restart-telegram.sh

100755100644
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ KILLED=false
4949
while IFS= read -r pid; do
5050
if [[ -n "$pid" ]] && kill -0 "$pid" 2>/dev/null; then
5151
echo " Killing odek telegram (PID $pid)..."
52-
kill "$pid" 2>/dev/null || true
52+
kill -HUP "$pid" 2>/dev/null || true
5353
KILLED=true
5454
fi
5555
done < <(pgrep -f "odek telegram" 2>/dev/null || true)

cmd/odek/main.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -403,11 +403,12 @@ done:
403403
// Same resolution model as runFlags: zero/nil = not set,
404404
// config loader merges file → env → CLI.
405405
type replFlags struct {
406-
ID string // session ID to resume
407-
Model string
408-
Thinking string
409-
Sandbox *bool // nil = not set
410-
PromptCaching *bool // nil = not set; true = enable prompt caching
406+
ID string // session ID to resume
407+
Model string
408+
Thinking string
409+
Sandbox *bool // nil = not set
410+
PromptCaching *bool // nil = not set; true = enable prompt caching
411+
InteractionMode string
411412

412413
// Sandbox-specific CLI flags
413414
SandboxImage string
@@ -473,6 +474,9 @@ func parseReplFlags(args []string) (replFlags, error) {
473474
case "--prompt-caching":
474475
f.PromptCaching = boolPtr(true)
475476
i++
477+
case "--interaction-mode":
478+
f.InteractionMode = args[i+1]
479+
i += 2
476480
default:
477481
// Unrecognized flag or positional — skip it
478482
i++

cmd/odek/repl.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,11 @@ func replCmd(args []string) error {
4747

4848
// Resolve config (before session creation so Session.Sandbox is set)
4949
resolved := config.LoadConfig(config.CLIFlags{
50-
Model: f.Model,
51-
Thinking: f.Thinking,
52-
Sandbox: f.Sandbox,
53-
PromptCaching: f.PromptCaching,
50+
Model: f.Model,
51+
Thinking: f.Thinking,
52+
Sandbox: f.Sandbox,
53+
PromptCaching: f.PromptCaching,
54+
InteractionMode: f.InteractionMode,
5455

5556
SandboxImage: f.SandboxImage,
5657
SandboxNetwork: f.SandboxNetwork,

cmd/odek/serve.go

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -241,19 +241,20 @@ func newServeAgent(resolved config.ResolvedConfig, system string, sendFn func(v
241241
}
242242

243243
agent, err := odek.New(odek.Config{
244-
Model: resolved.Model,
245-
BaseURL: resolved.BaseURL,
246-
APIKey: resolved.APIKey,
247-
MaxIterations: resolved.MaxIter,
248-
SystemMessage: system,
249-
NoProjectFile: resolved.NoAgents,
250-
Thinking: resolved.Thinking,
251-
Tools: tools,
252-
SandboxCleanup: sandboxCleanup,
253-
Renderer: nil, // silent — we stream via WebSocket
254-
Skills: &resolved.Skills,
255-
SkillManager: sm,
256-
MemoryConfig: resolved.Memory,
244+
Model: resolved.Model,
245+
BaseURL: resolved.BaseURL,
246+
APIKey: resolved.APIKey,
247+
MaxIterations: resolved.MaxIter,
248+
SystemMessage: system,
249+
NoProjectFile: resolved.NoAgents,
250+
Thinking: resolved.Thinking,
251+
InteractionMode: resolved.InteractionMode,
252+
Tools: tools,
253+
SandboxCleanup: sandboxCleanup,
254+
Renderer: nil, // silent — we stream via WebSocket
255+
Skills: &resolved.Skills,
256+
SkillManager: sm,
257+
MemoryConfig: resolved.Memory,
257258
ToolEventHandler: func(event, name, data string) {
258259
sendFn(map[string]any{
259260
"type": event,

0 commit comments

Comments
 (0)