gui/pkg
Snider 3012703763 feat(gui): ToolCallHandler + manifest injection in chat
New pkg/chat/tool_handler.go: ToolCallHandler interface + ToolCall
type + BuildToolManifest helper + Core-action dispatch adapter +
inline {"tool_call": ...} JSON parser. Service.Send now detects
inline tool calls during stream, invokes OnToolCall, persists a
'tool' result message, and continues the completion loop. Manifest
is prepended to system prompt when a handler is registered
(no-op when unregistered — back-compat).

Good/Bad/Ugly coverage in tool_handler_test.go: valid tool_call
dispatches through mock executor and lands in history; unknown
tool name surfaces error into conversation (not a silent drop);
malformed inline JSON does NOT dispatch — stream continues, no
executor call, assistant message preserves the raw tool_call
fragment for audit.

go vet + go test ./pkg/chat/... clean (codex 0.124.0, gpt-5.5,
LEK AGENTS.md loaded).

Closes tasks.lthn.sh/view.php?id=22

Co-authored-by: Codex <noreply@openai.com>
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-24 07:47:54 +01:00
..
browser Add GUI coverage tests 2026-04-17 18:08:38 +01:00
chat feat(gui): ToolCallHandler + manifest injection in chat 2026-04-24 07:47:54 +01:00
clipboard Fix GUI image bridge wiring 2026-04-15 23:22:04 +01:00
container Add missing GUI unit coverage 2026-04-15 22:59:42 +01:00
contextmenu Harden context menu nil backend paths 2026-04-17 20:01:58 +01:00
deno Implement P2P, Deno, and container spec gaps 2026-04-15 22:12:19 +01:00
dialog Add GUI coverage tests 2026-04-17 18:08:38 +01:00
display feat(gui): pkg/chat + gui.chat.* IPC actions (MVP chat surface) 2026-04-24 07:26:22 +01:00
dock feat: Wails v3 stub bridge + feature expansion + display bridge + MCP events 2026-03-31 17:42:09 +01:00
environment Harden environment file manager path handling 2026-04-17 19:49:52 +01:00
events Harden nil event handling 2026-04-17 21:01:05 +01:00
keybinding Harden GUI security boundaries 2026-04-15 17:19:11 +01:00
lifecycle feat(lifecycle): add AppMode type + DetectMode() 2026-04-23 13:12:12 +01:00
marketplace Harden websocket and marketplace failure paths 2026-04-17 20:38:57 +01:00
mcp feat(gui): pkg/chat + gui.chat.* IPC actions (MVP chat surface) 2026-04-24 07:26:22 +01:00
menu Harden menu builder against nil handles 2026-04-17 21:02:34 +01:00
notification Wire notification categories and layout helpers 2026-04-15 22:18:35 +01:00
p2p Harden p2p bridge cleanup 2026-04-17 20:12:18 +01:00
preload feat(gui): InjectPreload — storage polyfills + Electron shim + app preloads 2026-04-24 06:17:34 +01:00
screen Harden screen state boundaries 2026-04-17 20:00:27 +01:00
systray Add missing GUI unit coverage 2026-04-15 23:17:52 +01:00
webview Fix webview target matching 2026-04-17 18:00:49 +01:00
window feat(gui): 4 smart layout helpers + Good/Bad/Ugly coverage 2026-04-24 07:26:22 +01:00