Skip to content

Commit 9e82cfe

Browse files
Mikedev115claude
andcommitted
feat: live tool timeline, three new skills, LSP diagnostics, and an rtk that can't hang
The chat surface and the engine's tool layer, worked end to end. Chat - Thinking and the tool list take turns in one slot instead of stacking, both collapsed by default, with a count and failure tally on the toggle. - A reply is no longer a bubble: it uses the whole reading column, so tables and code stop being squeezed into 72% of it. - Attachments survive a reload. The transcript stored the sent text, markers and all, so reopening a session printed a raw "[attachment: …] path" line and no chip; the markers are now folded back into chips and thumbnails, which also repairs history already on disk. - Borderless tables, tinted inline code, unboxed code blocks, scroll-to-bottom, and a composer that grows to half the window instead of a fixed 220px. - Sidebar: chats and projects as one segmented switch, add-project and new-session as labelled rows, theme picker in the profile menu, AI identity moved to Settings where it has room. Settings lists built-in skills too — the page used to claim a fresh install had none. - Every colour pair the chrome depends on is now checked against all 14 themes by a real test. It found six that failed, including dashes drawn in a colour identical to the surface behind them. Engine - Tool events are a struct, not formatted text. The frontend decided success by matching the Thai word "สำเร็จ" at the end of a string, so translating that word would have marked every tool call failed. - A tool call is announced while its arguments are still streaming, with a line counter that ticks as content arrives. Writing an 800-line file used to be 42 seconds of complete silence, because the call is only dispatched once its JSON is complete. OpenCode has this as an open request (anomalyco/opencode#9737). - write and edit report line deltas; write steers new files into a per-session output folder when no project is focused, instead of dropping them in the user's home directory where the next chat overwrote them. - The system prompt now says to edit rather than rewrite whole files, to batch edits, and to grep or read narrowly rather than pull a large file into context. Nothing said any of that before, and the tool descriptions alone give a model no reason to prefer one over the other. Skills: 22 -> 25 - glob: find files by path pattern. filepath.Match cannot cross a separator, so "**/*.go" — the form every model reaches for first — matched nothing. - apply_patch: several edits across several files, atomically. Nothing is written unless every edit checks out; a half-applied patch leaves the model reasoning about code that does not exist. - diagnostics: a real LSP client (initialize, didOpen, publishDiagnostics) asking gopls/tsserver whether the change compiles. Servers install on first use, never at install time, following the judgment already made for rtk. - grep gained glob and context-line support, and no longer searches dependency or build directories — 10,826 of this repo's 12,073 files are node_modules, so the 200-result cap filled with vendored code before ever reaching src/. fs and the file tree share that one ignore list. rtk - Only rewrites commands it measurably shrinks: git log 185,616 -> 4,514 bytes, git diff 155,258 -> 28,306. It was also being used on go build, where a clean build went 0 -> 96 bytes and a failing one 218 -> 439. - Its "run rtk init -g" banner no longer reaches the model: 74 bytes per call, which is most of why small commands came out larger than they went in. - Its 5-second timeout was decorative. Stdout is a buffer, so os/exec waits on a pipe a grandchild still holds — and rtk is a process supervisor, so grandchildren are the normal case. One call had not returned after five minutes. WaitDelay makes the bound real, and the turn's context now reaches it so Stop can interrupt it. Also: the user's display name moved from localStorage to the preference file — localStorage is keyed by origin, so a name typed under `wails dev` was a different bucket from the built app's and had to be typed again on every switch. And node_modules is ignored at the repo root, not only under desktop/. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
1 parent 5a9bf39 commit 9e82cfe

67 files changed

Lines changed: 3499 additions & 400 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.gitignore‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ venv/
2424
/aetox.exe
2525
bin/
2626
dist/
27+
28+
# Node dependencies anywhere, not just desktop/ (desktop/.gitignore covers that
29+
# one). Running a frontend command from the repo root creates a node_modules
30+
# here, and without this rule it lands in a commit.
31+
node_modules/
2732
*.test
2833
*.out
2934
*.prof

‎README.md‎

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
No lock-in. No subscription pressure. No boundaries.
88
Your rules, your data, your AGI.
99

10+
**🌐 [ดูหน้าเว็บแนะนำ Aetox](https://mike0165115321.github.io/Aetox/)** — เห็นภาพว่ามันทำอะไรได้บ้างใน 1 นาที
11+
1012
---
1113

1214
## Aetox คืออะไร
@@ -86,9 +88,9 @@ Aetox ยังอยู่ในช่วงหล่อหลอม — แก
8688

8789
| ความสามารถ | รายละเอียด |
8890
|:-----------|:-----------|
89-
| **11 Providers** | OpenAI, Anthropic, DeepSeek, Google Gemini, Groq, Mistral, Together, Perplexity, Cohere, LM Studio, Ollama |
91+
| **13 Providers** | OpenAI, Anthropic, DeepSeek, Google Gemini, Groq, Mistral, Together, Perplexity, Cohere, OpenRouter, Z.ai, LM Studio, Ollama |
9092
| **Tool Calling** | model-driven tool loop — agent เลือกใช้ tools เอง |
91-
| **15 Tools ในตัว** | read, write, edit, list, shell, git, grep และอื่นๆ |
93+
| **26 Tools ในตัว** | read, write, edit, list, shell, git, grep, image_ocr, video_ocr, audio_transcribe, browser_* และอื่นๆ |
9294
| **Safety 3 ระดับ** | ถามก่อน → คำสั่งเสี่ยง → รันเต็มที่ |
9395
| **Multi-provider** | ใช้ providers ต่างกันใน session เดียวกัน |
9496
| **Model Switching** | เปลี่ยน provider/model ได้ทันที โดยไม่เสีย context |
@@ -176,7 +178,7 @@ wails build -nsis # พร้อมตัวติดตั้ง
176178
│ │
177179
├──────────────────────────────────────────┤
178180
│ Core Runtime │ ← แกนกลางที่ทำงานแล้ว
179-
│ 11 Providers | Tools | Turn Loop │
181+
│ 13 Providers | Tools | Turn Loop │
180182
│ Safety | Audit | Config │
181183
├──────────────────────────────────────────┤
182184
│ Terminal + File System │
@@ -200,12 +202,13 @@ wails build -nsis # พร้อมตัวติดตั้ง
200202
| **Perplexity** | `PERPLEXITY_API_KEY` | ✅ | ❌ |
201203
| **Cohere** | `COHERE_API_KEY` | ✅ | ❌ |
202204
| **OpenRouter** | `OPENROUTER_API_KEY` | ✅ | ✅ |
205+
| **Z.ai** | `ZAI_API_KEY` | ✅ | ✅ |
203206
| **LM Studio** | ท้องถิ่น (localhost) | ✅ | ❌ |
204207
| **Ollama** | ท้องถิ่น (localhost) | ✅ | ❌ |
205208

206209
---
207210

208-
## Tools ในตัว (22 ตัว)
211+
## Tools ในตัว (26 ตัว)
209212

210213
| Tool | ใช้ทำอะไร |
211214
|:-----|:----------|
@@ -231,6 +234,10 @@ wails build -nsis # พร้อมตัวติดตั้ง
231234
| `github_search` | ค้นโค้ด/repo บน GitHub |
232235
| `github_read_file` | อ่านไฟล์จาก repo GitHub |
233236
| `github_list_files` | ดูโครงสร้างไฟล์ของ repo GitHub |
237+
| `browser_open` | เปิดหน้าเว็บในแท็บ Workbench |
238+
| `browser_read` | อ่านหน้าเว็บ พร้อมแปะเลข ref ให้ทุก element |
239+
| `browser_click` | คลิก element ด้วยเลข ref |
240+
| `browser_type` | พิมพ์ลงช่อง หรือเลือก dropdown ด้วยเลข ref |
234241

235242
---
236243

@@ -255,9 +262,9 @@ Aetox/
255262
│ ├── memory/ # context management
256263
│ ├── model/ # provider types, factory, bootstrap
257264
│ ├── plan/ # execution planning
258-
│ ├── provider/ # provider catalog (11 providers)
265+
│ ├── provider/ # provider catalog (13 providers)
259266
│ ├── safety/ # 3-tier approval
260-
│ ├── skill/ # 15 built-in tools
267+
│ ├── skill/ # 22 built-in tools
261268
│ ├── think/ # thinking level configuration
262269
│ └── turn/ # turn pipeline — explicit command → model tool loop → chat (§17)
263270
│

‎desktop/app.go‎

Lines changed: 67 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import (
2929
"github.com/Mike0165115321/Aetox/internal/prompt"
3030
"github.com/Mike0165115321/Aetox/internal/safety"
3131
"github.com/Mike0165115321/Aetox/internal/skill"
32+
"github.com/Mike0165115321/Aetox/internal/turn"
3233

3334
wailsruntime "github.com/wailsapp/wails/v2/pkg/runtime"
3435
)
@@ -82,15 +83,20 @@ const maxToolHistory = 50
8283
// recordToolAction is the engine's live tool-call feed for this session,
8384
// kept for the Inspector's Command History panel. Only "call" events are
8485
// recorded — "result" events are noise for a command-log view.
85-
func (a *App) recordToolAction(action, detail string) {
86+
//
87+
// The event goes to the UI as a struct rather than a formatted string: the
88+
// frontend used to decide success by matching the Thai word "สำเร็จ" at the end
89+
// of a detail line, so localizing that word (or appending anything to it) would
90+
// have silently marked every tool call as failed.
91+
func (a *App) recordToolAction(ev turn.ToolEvent) {
8692
// Relay every call/result live to the chat's tool timeline.
8793
if a.ctx != nil {
88-
wailsruntime.EventsEmit(a.ctx, "agent:tool", map[string]string{"action": action, "detail": detail})
94+
wailsruntime.EventsEmit(a.ctx, "agent:tool", ev)
8995
}
90-
if action != "call" {
96+
if ev.Action != "call" {
9197
return
9298
}
93-
a.toolHistory = append(a.toolHistory, detail)
99+
a.toolHistory = append(a.toolHistory, ev.Label())
94100
if len(a.toolHistory) > maxToolHistory {
95101
a.toolHistory = a.toolHistory[len(a.toolHistory)-maxToolHistory:]
96102
}
@@ -155,10 +161,9 @@ type TreeNode struct {
155161
}
156162

157163
// treeIgnore skips VCS/build/dependency noise a dev never wants in the sidebar.
158-
var treeIgnore = map[string]bool{
159-
".git": true, "node_modules": true, "dist": true, "build": true,
160-
".vs": true, ".idea": true, "bin": true, "obj": true,
161-
}
164+
// It is skill.IgnoredDirs — the same set grep refuses to search — so the tree
165+
// and the search never disagree about what counts as the user's code.
166+
var treeIgnore = skill.IgnoredDirs
162167

163168
// ProjectTree walks the sandbox root and returns a flat, depth-first file
164169
// tree for the sidebar (dirs collapsed by default, matching Sidebar.svelte's
@@ -595,6 +600,25 @@ func (a *App) startup(ctx context.Context) {
595600
a.startNewSession()
596601
}
597602

603+
// outputSubdir is where a brand new file goes, relative to the sandbox root.
604+
//
605+
// Focused on a project, that is the project itself — the whole point of
606+
// focusing is that the AI works inside it. Unfocused, the root is the user's
607+
// home directory, so "write index.html" used to drop a stray file beside
608+
// Documents and Downloads, and the next chat that wrote index.html overwrote
609+
// it. Each session gets its own folder instead; the session id is already a
610+
// timestamp, so the folders sort by when the work happened.
611+
//
612+
// Read as a func at call time, not baked in at bootstrap: it changes every
613+
// time the user starts or opens a chat, and re-bootstrapping the engine to
614+
// change one folder name would be an absurd price.
615+
func (a *App) outputSubdir() string {
616+
if a.projectFocused || a.sessionID == "" {
617+
return ""
618+
}
619+
return "aetox/output/" + a.sessionID
620+
}
621+
598622
// focusNone re-roots the engine at the user's home dir and marks the app as
599623
// not focused on any project. Falls back to cwd only if home can't be resolved.
600624
func (a *App) focusNone() {
@@ -1166,14 +1190,21 @@ func (a *App) applyConfig(cfg config.Config) {
11661190
if a.agent != nil {
11671191
priorContext = a.agent.ContextMessages()
11681192
}
1169-
chatApp, agent, status, registry := bootstrapFromConfig(cfg, a.recordToolAction, a.emitAgentStatus, workbenchTools, a.mcp)
1193+
chatApp, agent, status, registry := bootstrapFromConfig(cfg, a.recordToolAction, a.emitAgentStatus, workbenchTools, a.mcp, a.outputSubdir)
11701194
a.chat = chatApp
11711195
a.agent = agent
11721196
a.cfg = cfg
11731197
a.modelStatus = status
11741198
a.registry = registry
11751199
if a.agent != nil {
11761200
a.agent.SetUsageReporter(a.recordTokenUsage)
1201+
// Draw the row while the model is still writing the call, not after,
1202+
// and tick its line count up as the content arrives. The executor emits
1203+
// the same label when the call actually runs, and the UI matches on it
1204+
// rather than drawing the call twice.
1205+
a.agent.SetToolCallProgressReporter(func(name, subject string, lines int) {
1206+
a.recordToolAction(turn.ToolEvent{Action: "call", Name: name, Subject: subject, Added: lines})
1207+
})
11771208
}
11781209
// A re-bootstrap (model/provider switch) creates a fresh agent — replay the
11791210
// old agent's context (minus its system prompt; the new agent builds its
@@ -1274,8 +1305,14 @@ func toMCPServers(cfgs []config.MCPServerConfig) []mcp.Server {
12741305
return out
12751306
}
12761307

1277-
func bootstrapFromConfig(cfg config.Config, onToolAction func(action, detail string), onStatus func(string), extraSkills []skill.Skill, mcpMgr *mcp.Manager) (*aetoxapp.App, *cognitive.Agent, string, *skill.Registry) {
1308+
func bootstrapFromConfig(cfg config.Config, onToolAction func(turn.ToolEvent), onStatus func(string), extraSkills []skill.Skill, mcpMgr *mcp.Manager, outputSubdir func() string) (*aetoxapp.App, *cognitive.Agent, string, *skill.Registry) {
12781309
defer debuglog.Block("bootstrapFromConfig")()
1310+
// Which model this actually resolved to. The log recorded that a bootstrap
1311+
// happened but never what came out of it, so "it switched models on its
1312+
// own" had no evidence either way — the same reason startup logs a
1313+
// checkpoint at all.
1314+
debuglog.Info("resolved model", fmt.Sprintf("%s / %s (think=%s, approval=%s)",
1315+
cfg.ModelProvider, cfg.ModelName, cfg.ThinkLevel, cfg.ApprovalMode))
12791316
status := model.ResolveStatus(cfg.ModelProvider, cfg.ModelName, nil)
12801317

12811318
providerDone := debuglog.Block("model.BootstrapProvider")
@@ -1312,7 +1349,8 @@ func bootstrapFromConfig(cfg config.Config, onToolAction func(action, detail str
13121349
})
13131350

13141351
registry := skill.NewDefaultRegistry(skill.RegistryOptions{
1315-
SandboxRoot: cfg.SandboxRoot,
1352+
SandboxRoot: cfg.SandboxRoot,
1353+
OutputSubdir: outputSubdir,
13161354
})
13171355
for _, s := range extraSkills {
13181356
if err := registry.Register(s, skill.SourceExternal); err != nil {
@@ -1357,6 +1395,24 @@ func bootstrapFromConfig(cfg config.Config, onToolAction func(action, detail str
13571395
return chatApp, agent, status, registry
13581396
}
13591397

1398+
// UserName / SetUserName back the sidebar footer's display name. They go
1399+
// through the preference file rather than localStorage for the reason spelled
1400+
// out on config.ModelPreference.UserName. persistModelPreference is a
1401+
// load-modify-save, so a later model switch leaves this field alone.
1402+
func (a *App) UserName() string {
1403+
pref, _, _ := config.LoadModelPreference()
1404+
return pref.UserName
1405+
}
1406+
1407+
func (a *App) SetUserName(name string) error {
1408+
pref, _, err := config.LoadModelPreference()
1409+
if err != nil {
1410+
return err
1411+
}
1412+
pref.UserName = strings.TrimSpace(name)
1413+
return config.SaveModelPreference(pref)
1414+
}
1415+
13601416
// persistModelPreference saves the current model/approval choice to the same
13611417
// preference file the CLI reads, so both surfaces stay in sync.
13621418
func persistModelPreference(cfg config.Config) {
@@ -1430,4 +1486,3 @@ func readGitBranch(root string) string {
14301486
}
14311487
return head
14321488
}
1433-

‎desktop/app_test.go‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"github.com/Mike0165115321/Aetox/internal/config"
1111
"github.com/Mike0165115321/Aetox/internal/model"
1212
"github.com/Mike0165115321/Aetox/internal/safety"
13+
"github.com/Mike0165115321/Aetox/internal/turn"
1314
)
1415

1516
func TestSafeSandboxPathAllowsInside(t *testing.T) {
@@ -177,10 +178,10 @@ func TestReadFileRejectsDirectory(t *testing.T) {
177178
func TestCommandHistoryOrderAndCap(t *testing.T) {
178179
a := &App{}
179180
for i := 0; i < maxToolHistory+5; i++ {
180-
a.recordToolAction("call", "action-"+string(rune('a'+i%26)))
181+
a.recordToolAction(turn.ToolEvent{Action: "call", Name: "action-" + string(rune('a'+i%26))})
181182
}
182183
// "result" events must be ignored.
183-
a.recordToolAction("result", "should-not-appear")
184+
a.recordToolAction(turn.ToolEvent{Action: "result", Name: "should-not-appear"})
184185

185186
hist := a.CommandHistory()
186187
if len(hist) != maxToolHistory {

‎desktop/frontend/package-lock.json‎

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎desktop/frontend/package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"@testing-library/jest-dom": "^7.0.0",
1616
"@testing-library/svelte": "^5.4.2",
1717
"@tsconfig/svelte": "^5.0.0",
18+
"@types/node": "^26.1.1",
1819
"jsdom": "^29.1.1",
1920
"puppeteer-core": "^25.3.0",
2021
"svelte": "^5.55.7",

0 commit comments

Comments
 (0)