Skip to content

Commit 668513c

Browse files
committed
v0.42.0: session_search tool — browse, search, and recall past sessions
New native tool: session_search with 4 actions: - list — recent N sessions with metadata - search — keyword search across task, buffer, and full transcripts - get — load full session by ID (metadata + buffer + message count) - find — match sessions by task/title Keyword search uses two-phase strategy: 1. Task + buffer match (uses session index, no file I/O) 2. Deep search — loads sessions and searches full messages when needed Zero new dependencies (stdlib + existing session package) 21 new tests covering all actions, edge cases, empty store, limits Narrator emoji already mapped (🧠 via existing render entry)
1 parent 3949a94 commit 668513c

10 files changed

Lines changed: 961 additions & 12 deletions

cmd/odek/main.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,7 +1002,7 @@ func run(args []string) error {
10021002

10031003
// Sandbox setup
10041004
var sandboxCleanup func() error
1005-
tools := builtinTools(resolved.Dangerous, sm, nil, resolved.MaxConcurrency, resolved.Transcription)
1005+
tools := builtinTools(resolved.Dangerous, sm, nil, resolved.MaxConcurrency, resolved.Transcription, nil)
10061006

10071007
// MCP server tools
10081008
var mcpCleanup func()
@@ -1382,7 +1382,7 @@ func injectFilesToSandbox(containerName string, files []string, cwd string) (int
13821382
return injected, nil
13831383
}
13841384

1385-
func builtinTools(dc danger.DangerousConfig, sm *skills.SkillManager, approver danger.Approver, maxConcurrency int, tc config.TranscriptionConfig) []odek.Tool {
1385+
func builtinTools(dc danger.DangerousConfig, sm *skills.SkillManager, approver danger.Approver, maxConcurrency int, tc config.TranscriptionConfig, store *session.Store) []odek.Tool {
13861386
tools := []odek.Tool{
13871387
&shellTool{
13881388
dangerousConfig: dc,
@@ -1416,6 +1416,7 @@ func builtinTools(dc danger.DangerousConfig, sm *skills.SkillManager, approver d
14161416
&trTool{dangerousConfig: dc},
14171417
&wordCountTool{dangerousConfig: dc},
14181418
newTranscribeTool(dc, tc),
1419+
newSessionSearchTool(store),
14191420
newBrowserTool(dc),
14201421
}
14211422

@@ -1960,7 +1961,7 @@ func continueCmd(args []string) error {
19601961
"./.odek/skills",
19611962
)
19621963
}
1963-
tools := builtinTools(resolved.Dangerous, sm, nil, resolved.MaxConcurrency, resolved.Transcription)
1964+
tools := builtinTools(resolved.Dangerous, sm, nil, resolved.MaxConcurrency, resolved.Transcription, store)
19641965
var sandboxCleanup func() error
19651966

19661967
// MCP server tools

cmd/odek/main_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ func TestRun_NoAPIKey(t *testing.T) {
201201
}
202202

203203
func TestBuiltinTools(t *testing.T) {
204-
tools := builtinTools(danger.DangerousConfig{}, nil, nil, 3, config.TranscriptionConfig{})
204+
tools := builtinTools(danger.DangerousConfig{}, nil, nil, 3, config.TranscriptionConfig{}, nil)
205205
if len(tools) == 0 {
206206
t.Fatal("builtinTools() returned empty slice")
207207
}

cmd/odek/mcp.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Flags:
7373
}
7474

7575
// Build tools
76-
toolSet := builtinTools(resolved.Dangerous, sm, nil, resolved.MaxConcurrency, config.TranscriptionConfig{})
76+
toolSet := builtinTools(resolved.Dangerous, sm, nil, resolved.MaxConcurrency, config.TranscriptionConfig{}, nil)
7777

7878
// MCP server tools — connect and discover before sandbox
7979
var mcpCleanup func()

cmd/odek/repl.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func replCmd(args []string) error {
7979
"./.odek/skills",
8080
)
8181
}
82-
tools := builtinTools(resolved.Dangerous, sm, nil, resolved.MaxConcurrency, config.TranscriptionConfig{})
82+
tools := builtinTools(resolved.Dangerous, sm, nil, resolved.MaxConcurrency, config.TranscriptionConfig{}, nil)
8383
var sandboxCleanup func() error
8484

8585
// MCP server tools

cmd/odek/serve.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ func newServeAgent(resolved config.ResolvedConfig, system string, sendFn func(v
187187
approver := newWSApprover(sendFn)
188188
resolved.Dangerous.Approver = approver
189189

190-
tools := builtinTools(resolved.Dangerous, sm, approver, resolved.MaxConcurrency, config.TranscriptionConfig{})
190+
tools := builtinTools(resolved.Dangerous, sm, approver, resolved.MaxConcurrency, config.TranscriptionConfig{}, nil)
191191

192192
// Find the delegateTasksTool to wire up sub-agent log streaming
193193
var subagentTool *delegateTasksTool

0 commit comments

Comments
 (0)