feat(agent): tools on by default, personal-folder cwd, streamed final answer
- GUI: agent mode (tools) enabled by default; the 🤖 toggle still turns it off.
- shell_exec defaults to the session's personal folder (~/.strata-ctl/sessions/<name>)
when the model omits cwd, so the agent's home base matches its identity reminder;
full host access retained (cd / absolute paths). run_loop gains a LoopContext
(runner/store/default_cwd/max_iters/progress) to stay within the arg-count lint.
- Agent final answer now streams live: the model step uses service.stream, emits
AgentEvent::Delta (reasoning + content) while generating, and returns the
accumulated response for tool detection + persistence. The GUI renders a live
assistant bubble (thinking auto-opens, folds when the answer starts) instead of
receiving the whole final answer at once.
- Verified live: 76 delta events over 10.75s, pwd -> sessions/<name>, correct answer.
- 122 tests + 2 ignored; clippy/fmt clean.
This commit is contained in:
1 parent
ebbd9e72e8
commit
5117ecad7a
5 files changed
+259
-40
No files matched your search
@@ -144,20 +144,23 @@ copied into `data/` once on first run (the original is left in place).
|
||||
|
||||
## Agent mode
|
||||
|
||||
The GUI model can **act**, not just chat. Toggle the 🤖 button and the model runs as
|
||||
an agent with a single universal tool, **`shell_exec`** (a shell is universal: file
|
||||
ops, programs, system inspection, web via curl, git, …). A bounded server-side loop
|
||||
drives `model → shell_exec → result → model → … → final answer`, persisting the whole
|
||||
trajectory and streaming progress events (`tool_call` / `tool_result` / `final`) so
|
||||
the GUI shows every command and its output inline — **observability without a
|
||||
confirmation gate**.
|
||||
The GUI model can **act**, not just chat. Tools are **on by default** (the 🤖 button
|
||||
toggles them): the framework is meant to act, not just chat. The agent has a single
|
||||
universal tool, **`shell_exec`** (a shell is universal: file ops, programs, system
|
||||
inspection, web via curl, git, …). A bounded server-side loop drives
|
||||
`model → shell_exec → result → model → … → final answer`, persisting the whole
|
||||
trajectory and streaming progress events — `delta` (the model's thinking and final
|
||||
answer, token by token), `tool_call` / `tool_result` (every command and its output
|
||||
inline) and `final` — so the wait is always visible progress, **observability without
|
||||
a confirmation gate**.
|
||||
|
||||
Two operating modes are planned, separated by the *environment* rather than per-call
|
||||
approval:
|
||||
|
||||
- **Base / host mode** (implemented): `shell_exec` runs directly on the host via
|
||||
`bash -lc` (with `cwd`, a timeout and an output cap). This is a trusted machine;
|
||||
the agent has the same freedom you would give a local operator.
|
||||
`bash -lc`, starting in the session's **personal folder** by default (override with
|
||||
`cwd`), with a timeout and an output cap. This is a trusted machine; the agent has
|
||||
the same freedom you would give a local operator.
|
||||
- **Isolated mode** (planned): the same tool routes to a sandboxed runner — the
|
||||
team's Docker-container MCP server. The user supplies the container; provisioning
|
||||
is on them. Execution sits behind a `ShellRunner` trait, so the isolated runner
|
||||
@@ -229,7 +232,7 @@ later adaptation round.
|
||||
|
||||
## Status
|
||||
|
||||
Working and tested (121 tests, plus 2 real-file tests run on demand). Text, images,
|
||||
Working and tested (122 tests, plus 2 real-file tests run on demand). Text, images,
|
||||
the full client-side tool loop, the Anthropic endpoint, the web GUI (session
|
||||
context, streaming, stats, **file/image upload**) and **agent mode** (the model
|
||||
using `shell_exec` on the host) have been validated live against the real Inkling
|
||||
|
||||
Reference in new issue
Block a user