Repository navigation
GAL v1.9.14
GAL v1.9.14
Highlights
- Past conversations become memory the agent can query.
gal chatnow writes the samehistory.dbas the GUI, so a terminal session exists in the sidebar and is readable by the model — before, the sidebar's whole notion of "this session exists" washistory.db, and a terminal session had none.serve(channels, API, timers) writes one too, through the same writer as the TUI, so a long conversation with a bot no longer answerssession_historywith "no record".-mand--pipestill do not write: they are one-shot script calls, and recording them would put every script run into the sidebar and into every cross-session search. - The write protocol now lives in
history_entry.go's constructors and a turn's rows inchat.TurnTranscript; TUI, GUI and serve go through them instead of assembling three copies. Both sides of that protocol failed silently —spawnJSON was parsed in a silenttry/catch, role dispatch had no fallback — so a new role was stored, searched and exported but never drawn. - New tool
session_history(read-only, injected into every agent including sub-agents, so no preset declares it):searchacross earlier sessions,turnsfor an outline,readby id. It answers "how was this done before";context_recallanswers "what did this turn compress away";memoryanswers "what conclusion is worth keeping". - Those layers enter an ordinary agent's prompt for the first time.
## Memory and Recalllists only the layers the agent can reach: a sub-agent's global memory is read-only, and_adminhas nomemorytool so that layer is omitted. - The cost went down for the main agent — three self-descriptions replaced, 12,459 → 12,355 characters. Sub-agents grow about 1.2K (5,704 → 6,900): they had a
§learnedconvention and now have four destinations. The budget test was corrected too; it never registered thememorytool, so it measured an imaginary prompt. servepasses the full-result callback so history stores the whole result, while channel logs and API clients still get the line truncated at 1000 characters: aligning history must not enlarge someone else's response.- Ownership: the GUI applies its sidebar rule, so one web principal cannot read another's sessions; management sessions are excluded from session-wide search while still able to read themselves. The sub-agent registry inherits both — without them the tool is a hole through the ownership check, which its first version was.
- A session with no display record is counted as "no record" and the result says so, rather than letting "not found" read as "never happened". Entries over 2000 characters are truncated and marked.
- Fixed a check that had never worked:
tool_result'ssuccessused!HasPrefix(lower(result), "error"), and that string is "tool name -> result (duration)", so it always began with the tool name — every failed call was recorded as a success, which is why cards and exports always showed ✓. It now splits on->and honours only the engine'serror:marker. - Terminal display still uses 1000 characters / 20 lines but strips the duration suffix before cutting, since the engine no longer truncates for history and a whole-line cut would remove the only place the duration appears.
- Master switch like
memory:session_history: { enabled: false }removes the tool only. Records are still written, becausehistory.dbis also what makes a session exist in the sidebar. There is still no per-agent switch: injection works as a floor precisely because a prompt cannot ask "do not install this". /clearnow clears four things — engine messages,session.json,history.dband thecontext_recallCtxV2 archive. It used to clear only engine messages, so a resume rebuilt fromsession.json, a refresh redrew fromhistory.db, andsession_historykept answering with turns the user was told were gone.- Repaired an old class of file:
namewent intoCREATE TABLEon 2026-06-05 with no matchingALTER, so every query against an olderhistory.dbfailed withno such column: name— the whole file unreadable, hidden by cross-session search counting it asFailed.
Sandbox: bash admits it is unavailable inside a container
EnsureSandbox()'s root branch used toreturn true, on the grounds that mount namespaces need CAP_SYS_ADMIN and root has everything. In a container the uid is 0 but the capability is gone, soBashDisabledstayed false, the prompt claimed "bash: sandboxed", and every call failed separately withoperation not permitted— naming neither the missing capability nor the disabled tool.- Root is probed now, with exactly the flags the real start uses; a test pins the two together. Cloning alone cannot answer "does it install" — a root container with
--cap-add SYS_ADMINclones and mounts fine, then dies making the overlay root read-only, so the probe passed and every call failed. It now runs the steps that genuinely fail (private propagation, its own procfs, the whole tree read-only) and hands the kernel's refusal to the user, so all four container shapes degrade before the first command. A cgo build does not start at all in a musl image, so container verification needs a static build. - The probe's read-only step uses the recursive leaf-before-root order: on a host where the sandbox works,
/alone returnsEBUSYwhile the full pass succeeds — trusting the single call would have declared bash disabled for every session on this WSL machine. - Found along the way (pre-existing):
lockDownSandboxdrops the capability bounding set viasyscall.AllThreadsSyscall6, which in any cgo-linked binary returnsENOTSUP— a Linux sandbox needsCGO_ENABLED=0, and so doesgo test ./cmd.mount private procnow falls back to a procfs withouthidepidwhen the kernel refuses it, explaining the degradation, and the doubledsandbox: sandbox:prefix is gone.
Sandbox: a command is not lost to its own bookkeeping
- Two
connectfailures collapsed into one error: nobody listening (the agent is gone) and a momentarily full queue (the agent is busy). The first was taken as proof of death and the group SIGKILLed, so one hiccup killed every command on that sandbox.connectretries with a backoff, and the agent is replaced — with a log line, since it really does kill other things — only if it still fails. ensure()'s health check (signal 0succeeds + the socket path exists) could be fooled twice: an unreaped zombie answerssignal 0, and a SIGKILLed agent leaves its socket behind. It is now "not a zombie" and "that path really is a socket".- The agent is PID 1 of the sandbox namespace, so an unhandled panic on its request path costs the whole sandbox.
serveOneCommandcatches it and returns the panic to that one connection — a guardrail proven by an injected panic, not a fix for a demonstrated fault. - A dead agent now says how it died: its own stderr and
/proc'sexit_code, e.g.killed by signal 9; agent output: panic: …, separating OOM, panic and a dropped connection. The read precedeskill(), because the firstWait()reaps the child. In-flight commands are not retried — a shell command is not idempotent.
hooks: a path rule judges the file, not the string
path_regexmatched the raw argument, so two cheap escapes walked through a policy meant to keep a session inside one directory:file_read ../home/gal/.gal/gal.yamlread~/.gal/gal.yaml, andfile_read /work/escape/gal.yamlmatched a rule anchored on/work/while pointing into~/.gal. The regex is now evaluated against both the original spelling and the absolute, symlink-resolved form. A union only makes deny/confirm fire more often.- The resolver moved into
safefile, shared by the hook and safe-mode gates —toolimportshook,hookcannot importtool, and two copies of a resolver are how they diverge. - Two ways a policy could vanish silently are closed: a
regexp.Compileerror was discarded, leaving a rule with no condition that matched every call, so one typo vetoed every tool the user had not restricted; andLoad's error was dropped by serve, gui and exec whileMergeswallowed parse errors, so "an unparseable policy" looked exactly like "no policy". Both are now reported.
API: parallel tool events no longer trample each other
- The engine starts one goroutine per parallel tool on both response paths. Streaming wrote two tools' frames into each other —
http.ResponseWriterdoes not support concurrency and a frame is several writes — so the client saw{"choices"data: {…}and the whole stream was void; a remote spawn reported "corrupt event", not "slow tool". Non-streaming appended to a shared slice from the same goroutines: 12 parallel tools produced 10 of 24 events, silently. Both sinks have a lock, and a test fires concurrently the way the engine does.
serve: the help text is the interface it serves
gal serve help apiis a caller's only description of the interface and had drifted far enough to cost them: it documented a "stateless chat" route that only ever answers 400session_required— a request built from the help was the one the server always rejects — and two status words it never produced ({"status":"clearled"}, fixed in the code rather than the docs). None of the rules that matter were written: only the lastusermessage is read,contentmust be a JSON string, an unsupported model is ignored,tool_eventsexists. Response shapes were missing entirely, including that a mid-stream failure sends an error object instead of[DONE].- The admin gets the operator's half:
serve.yamlis read once at startup, what an emptyagentresolves to, that each API session works in<workdir>/api_<endpoint>_<session>/and is never cleaned up, whereengine_error's cause is recorded, and how to verify a configuration withGET /v1/capabilities/{endpoint}. The diagnostic table is keyed by the error the caller sees, including "api_key_requiredbehind a proxy is expected" — that check reads the TCP peer, notX-Forwarded-For. - The help text is pinned to the implementation: every route, error code and status word is asserted against
apiHelp, contract tests drive the handlers, andAPIConf's fields are compared by reflection, so a yaml field added without documentation fails the build. - The admin manual was aligned against the code, correcting two wrong statements and adding
stream_idle_timeout,long_term_memory,gal skills install/remove,~/.gal/workspace/admin, and the fact thatmanaged_pkiis machine-written state never to be edited.
GUI: the management session is its own session
- Exiting admin means "restore the agent this session used before admin", and the Management center's own session never had another one — it was born as the admin workspace. Exiting produced a session running an ordinary agent while carrying the persistent
Managedflag: an ordinary conversation invisible in the sidebar, search, Sessions tab and exports, with no entry point at all. The refusal is server-side, because the side that owns the state must answer for it.managementWorkspaceis the single predicate both sides share — in-memory flag or persistent marker, never "the localised title reads Management", whose false positive would trap a user in a session he had named Management himself. Already-exited sessions cannot be migrated (a live workspace and an exited one are identical on disk), so the recovery steps are inDESIGN.md. - The Management session's working directory was resolved rather than decided:
cfg.WorkDir, the process CWD, or~/.gal. Nobody chose the middle value, so launching from a desktop shortcut or a terminal opened in home made management open on GAL's own configuration. It now works in~/.gal/workspace/admin, next to the serve sessions it manages. The rule is re-applied inloadOrCreateSessionforManagedsessions without aRelated, which is where existing sessions get repaired; companions still inherit their conversation's directory. - Reopening the same task from the Management panel replaced the session rather than returning to it, building a fresh session over the running one. With a turn in flight the replacement had only on-disk history, its running flag was false, and the abandoned one kept running unreachable — both with timer loops and save writers, so whoever saved last won and the in-flight turn vanished. It now uses the map check every other load path already has.
GUI: say what is being done, and that it is done
- A collapsed tool section's title was the whole view of that work and read "3 calls", answering neither "what is happening" nor "is it still going" — the second being the bug report: the dots vanished with the last call, so every gap between calls (most of a round's real time) rendered as a finished title over a round still working. The title is now re-derived on each update from
calling(the in-flight call, named the way its card names it),thinking(running, no call in the section, plus the count) oridle;data-phasedrives the dots, while.runningstill means only "a call is in flight". - A finished thought kept saying "Thinking…" until the session ended. It now carries both words and CSS picks one by the block's own class — there is no text for an exit to rewrite, so no exit can forget.
- Leaving search left the result panel at the foot of the sidebar with dead rows: a search answer is a
sessionsframe, so it was stored in the session list, handing a matched subset to everything that reads that list. Results now live per endpoint, the list is never touched and exiting is a local repaint; the frame declares which list it carries, and "I can answer" is declared at the handshake. One panel element per search, written only when the input is unfocused; each endpoint has waiting / ok / down / silent states so a partial answer cannot look complete; the list stops scrolling while searching, since nested scroll containers let a row move between mousedown and mouseup. - A language switch never reached the sidebar — the shell had no
I18N.onChangehandler and the selector callssetLocalein place. Measured in Chromium, the dictionary answered "搜索" while the button read "Search" and the whole search panel was English. Role badges also rendered the raw token, so "user" appeared inside a Chinese panel; tokens are now translated at display time. - The console was flooded by Chromium's "A form field element should have an id or name attribute" (15 per session page, 99+ with editors open). Almost every editor is built in JS and a builder does not name what it builds; it now uses
namewherever an element repeats. Measured: 15 of 31 fields unnamed → 0. - A folder chip squeezed a whole table, since a column takes the width of the widest thing in it. Chips are now
max-width: 28chand wrap. The first attemptmin(28ch, 100%)capped the chip while still letting the column claim the path — the percentage resolves against a cell width the rule itself decides, so the cycle is discarded and layout falls back to max-content.
Development and verification
- Browser checks kill by process group, not by process: one chromium launch is eleven processes, two of which detach to init within seconds, so without
Setpgidthey inherited the test binary's group and teardown reached only the leader. - WSL routes core dumps to
/wsl-capture-crash, so a Chromium segfault wrote 87 GB into Windows' temp.ulimit -c 0does not apply to piped dumps and Chromium's crash-reporter flags changed nothing; the fix is each process'scoredump_filter, zeroed by a shell beforeexecand inherited across fork. - Documented so the next reader does not "fix" a deliberate decision: a skill's scripts never go through the sandbox, because skills exist to reach what a confined child cannot — their authority comes from their content, and what they get is hygiene rather than isolation.
Install
Download the archive for your platform below, verify it against checksums.txt, then run the binary (or install.sh on macOS CLI).
GAL v1.9.14 中文说明
重点更新
- 终端里聊过的,模型也能查到。
gal chat现在和 GUI 写同一份history.db,于是终端里开的会话在侧边栏里存在、模型也读得到——此前侧边栏判断「这个会话存在」的唯一依据就是history.db,而终端会话没有。serve(通道、API、定时器)现在也写,且和 TUI 走同一个写入器,此前通过机器人聊了很久的事,session_history会答「没有记录」。-m、--pipe仍不写:它们是脚本的一次性调用,记下来等于把每次脚本运行都塞进侧边栏和每次跨会话检索里。 - 写入协议收进了
history_entry.go的构造函数,轮次内的行收进chat.TurnTranscript,TUI、GUI、serve 都走它们而不是各拼一份。那份协议此前只有一个实现者、没有写下来的契约,而两侧都是静默失败:前端解析spawn的 JSON 用了不报错的try/catch,角色分发没有兜底分支——加了新角色,记录会被存下、被检索、被导出,就是画不出来。 - 新工具
session_history(只读,自动注入给所有 agent 含子代理,预置 agent 不必声明):search检索更早的会话,turns给提纲,read按 id 读条目。它答「这件事之前怎么做的」,context_recall答「这一轮压缩掉了什么原文」,memory答「哪个结论值得跨会话记住」——五个去处各答一个问题,不合并也不删减。 - 这五层第一次写进普通 agent 的提示词,此前那份清单只存在于管理员手册。现在是一节
## Memory and Recall,只列它够得到的层:子代理的全局记忆标明只读,_admin没有memory工具,也就不提这一层。 - 代价对主 agent 是降的:它替掉了三节自我描述(
## Context Memory讲的是上下文压缩却顶着记忆的名字、## Project Memory、## Long-term Memory),12,459 → 12,355 字符。子代理涨了约 1.2K(5,704 → 6,900):它此前只有一句§learned约定,现在有四个去处。预算测试也补准了——它此前没注册memory工具,量的是比真实提示词小 100 字符的假想提示词。 serve传了完整结果回调,历史因此存整份结果;而通道日志和 API 客户端收到的仍是按 1000 字符截断的那一行:对齐历史不该顺手撑大别人的响应。- 读得到谁:GUI 用它给侧边栏定的归属规则,一个 web 主体读不到别人的会话;管理会话对所有会话范围的检索一律排除,但仍能读自己。子代理的 registry 继承这两条,否则装上这个工具就是绕过归属检查的口子——它的第一个版本正好漏了这一处。
- 没有展示记录的会话被数成「没有记录」并在结果里写明,而不是让「没找到」读成「没发生过」。单条超过 2000 字符会截断并标注,参数按引擎原有的 4000 rune 上限。
- 修掉一个一直没生效的判据:
tool_result的success按!HasPrefix(lower(result), "error")判断,而那个字符串是「工具名 -> 结果 (耗时)」,永远以工具名开头——每一次失败的调用都记成了成功,卡片和导出里的 ✓/✗ 因此一直是 ✓。现在按->切开,只认引擎真正的标记(error:带冒号,所以提到 “error handling notes” 的结果仍是成功)。 - 终端的显示规则仍是 1000 字符 / 20 行,但改成「先摘耗时后缀、再截正文」:引擎为了把完整结果留给历史不再替它截断,整行截断会把唯一显示耗时的地方一起截掉。
- 这个工具和
memory一样有总开关:session_history: { enabled: false }。关掉只移除工具,记录照写,因为history.db也是侧边栏判断会话存在的依据。开关在三个前端建 registry 时生效,子代理的 registry 显式继承它,提示词那一节随之消失,gal tools如实标成已关闭。per-agent / per-session 开关仍然没有:注入能当「地板」,正因为提示词没法要求「别装这个」。 /clear现在清四份:引擎消息、session.json、history.db、context_recall的 CtxV2 归档。它此前只清引擎的消息列表,于是 resume 又从session.json重建、刷新又从history.db重画、session_history继续把用户被告知已消失的轮次答出来。- 修好一类老文件:
name是 2026-06-05 直接写进CREATE TABLE的列,没有对应的ALTER,所以那天之前的history.db每个查询都报no such column: name——整个文件读不出,被跨会话检索数进Failed藏住了。turns也不再提供before分页,那个字段已从 schema 去掉。
沙箱:容器里跑 gal 时必须承认 bash 不可用
EnsureSandbox()的 root 分支此前直接return true,理由是「挂载 namespace 要 CAP_SYS_ADMIN,root 有全部能力」。容器里 uid 仍是 0 而能力已经没了,于是BashDisabled一直 false,提示词照旧写「bash: sandboxed」,每次 bash 调用各自失败一次报operation not permitted,既没提缺哪个能力,也没说工具已禁用。- 现在 root 也探,用和真正启动完全相同的 flags(
CLONE_NEWNS|CLONE_NEWPID);探不通就禁用,提示词换成bash tool: DISABLED,bash返回明确拒绝,其余工具照常。测试把探测 flags 和启动 flags 钉在一起,两者不可能悄悄分叉。 - 只 clone namespace 答不了「装得起来吗」:root +
--cap-add SYS_ADMIN的容器 clone 与挂载都过,最后死在把 overlay 根改成只读——探测通过、提示词说可用、每次调用再各自失败。现在探测自己跑一遍真正会失败的几步(private 传播、自己的 procfs、整棵挂载树改只读),把内核的拒绝原话交给用户,四种容器形态都在第一条命令之前降级。实测 docker 28 + alpine + 静态gal:root 默认 ✗、--cap-add SYS_ADMIN与--privileged都死在remount ro、非 root 探测失败,全部干净降级。cgo 构建在 musl 镜像里根本起不来,所以容器验证必须静态编译。 - 探测改只读走递归的「先叶子后根」顺序,而不是只对
/调一次:在沙箱本来能跑的宿主上单独对/会得到EBUSY,而完整一遍成功。只信单次调用会让这台 WSL 上所有会话的 bash 被误判禁用。 - 顺带发现(既有问题):
lockDownSandbox用AllThreadsSyscall6丢能力边界集,而任何 cgo 链接的二进制里它稳定返回ENOTSUP——Linux 沙箱需要CGO_ENABLED=0,go test ./cmd也需要。另外mount private proc在内核拒绝hidepid时退到不带它的 procfs 并在 stderr 说明降级,sandbox: sandbox:的双前缀也不再出现。
沙箱:一条命令不会被它自己的记账丢掉
connect的两种失败会合成一个错误:没有人在听(agent 没了)和监听队列一时满了(agent 正忙)。前者被当成死亡的证据,整个进程组被 SIGKILL,于是跑着不止一条命令的沙箱一次抖动就全杀了。现在带小退避重试,仍不通才替换 agent,并记日志——它确实会杀掉这个 agent 上别的东西。ensure()的健康判据「信号 0 通得过 + socket 路径存在」两条都能骗过它:僵尸进程照样应答信号 0,被 SIGKILL 的 agent 会把 socket 留在原地。现在是「不是僵尸」且「那个路径确实是 socket」。- agent 是沙箱 namespace 的 PID 1,它 per-request 路径上一个没接住的 panic 会赔掉整个沙箱。
serveOneCommand接住它,把 panic 回给那一条连接,堆栈写进宿主的 stderr——这是靠注入 panic 验证的护栏,不是对已证实故障的修复。 - agent 死了要说怎么死的:agent 自己的 stderr(Go 的 panic 就写在那里)与
/proc里尚未回收时的exit_code,读出来像the agent was killed by signal 9; agent output: panic: …,把 OOM、panic 与「对端还活着时断掉的连接」分开。读取发生在kill()之前,因为第一次Wait()就回收了子进程。在途命令刻意不重试:shell 命令不是幂等的。
hook:路径规则按文件判,不按字符串
path_regex匹配的是原始参数,于是两条便宜的逃逸穿过一条本该把会话关在一个目录里的策略(safe mode 关掉时实测):file_read ../home/gal/.gal/gal.yaml读到了~/.gal/gal.yaml,file_read /work/escape/gal.yaml匹配上锚定/work/的规则却指向~/.gal。现在同时对原始拼写和「绝对化 + 解符号链接」后的形式求值,任一命中即触发。取并集只会让 deny/confirm 更常触发,按相对片段写的规则照旧生效。- 解析器移进
safefile,hook 与 safe-mode 闸门共用一个函数——tool导入hook、hook不能再导入tool,而两份重复的解析器正是它们分歧的方式。 - 补掉两条「策略可以无影无踪消失」的路,因为静默缺席的规则和没有规则一样:
regexp.Compile的错误被丢弃,留下一条没有条件的规则,它匹配每个调用,一个笔误就否决了用户没限制过的所有工具;现在编译不过的整条丢弃并报出来,其余部分照常生效。Load的错误被 serve、gui、exec 丢弃、Merge吞掉读取与解析错误,于是「解析不了的 policy」和「没有 policy」长得一样;现在都返回错误,serve 与 gui 写进srvlog,chat 与gal exec写进 stderr。
API:并行工具的事件不再互相踩
- 引擎为每个并行工具各起一个 goroutine,两条响应路径上都有多个 goroutine 往同一个 sink 写。流式把两个工具的帧写进了对方里——
http.ResponseWriter不支持并发而一帧是多次写——客户端收到{"choices"data: {…}这样的行,整个流作废,远程 spawn 报的是「事件损坏」而不是「工具慢」。非流式从同一批 goroutine 往共享切片追加:12 个并行工具只产出 24 个事件里的 10 个。两个 sink 现在各有一把锁,测试按引擎的方式并发触发。
serve:帮助文本就是它实际服务的接口
gal serve help api是调用方了解接口的唯一地方,而它已漂到会让人付代价:它写着一条「无状态聊天」路由,而那条路由只会答 400session_required——照帮助搭出来的请求正是服务端永远拒绝的那一个;它写着两个从不产出的状态词({"status":"clearled"},改的是代码而不是文档)。真正重要的规则一条没写:只读最后一条user消息、content必须是 JSON 字符串、不支持的 model 被忽略、tool_events存在。答案形状整节缺失:同步 JSON 体、SSE 帧(含gal_tool/gal_tool_result)、以及流中途失败发 error 对象而不是[DONE]。错误码表、会话 id 按 endpoint 分命名空间、session busy、unix socket 形式也都没有。- 管理员拿到运维的那一半:
serve.yaml只在启动时读一次(api 改动要重启,启动横幅报出解析后的「endpoint -> agent (auth)」)、agent为空即default_agent、每个 API 会话工作在<workdir>/api_<endpoint>_<session>/且从不清理、engine_error的因由记在哪、以及用GET /v1/capabilities/{endpoint}端到端验证。诊断表按调用方看得见的错误作键,包括「过代理时遇到api_key_required是预期行为」——那个检查读的是 TCP 对端,不是X-Forwarded-For。 - 帮助文本被钉在实现上而不是复述一遍:每个路由、每个错误码、两个状态词、以及「无状态」那句话的缺席都对着
apiHelp断言,契约测试直接驱动处理器,APIConf的字段由反射比对,加一个 yaml 字段而不写文档会直接构建失败。 - 管理员手册按代码对齐,改掉两条错的(一个被说成总是可见、而隐藏会话根本不会有的按钮;
context_limit文档写 400000 而代码用 600000),并补上stream_idle_timeout、long_term_memory、gal skills install/remove、~/.gal/workspace/admin、以及managed_pki是机器写的状态、绝不手改。
GUI:管理会话是它自己的会话
- 退出管理被定义为「恢复进管理之前那个 agent」,而 Management center 自己的会话从来没有过别的——它一出生就是 admin workspace。于是退出产出一个跑着普通 agent、却仍带着持久
Managed标记的会话:一段普通对话,在侧边栏、搜索、Sessions 标签和导出里都看不见,用户继续说的话全落进没有入口的会话。拒绝发生在服务端,因为拥有状态的那一侧必须为它作答。managementWorkspace是两侧共用的唯一判据——内存标志或持久标记,绝不用「本地化标题恰好叫 Management」这种启发式,那的假阳性会把用户困在自己取名叫 Management 的普通会话里。旧行为下已退出的会话没有东西能修(活着的 workspace 和已退出的在磁盘上一模一样),恢复步骤写在DESIGN.md。 - Management 会话的工作目录是「解析」出来而不是「决定」的:
cfg.WorkDir、进程 CWD、~/.gal。中间那个值没人选过,于是从桌面快捷方式启动、或在 home 里开终端,管理就开在 GAL 自己的配置上。现在它工作在~/.gal/workspace/admin,就在它管的那些 serve 会话旁边,按需创建并按任何工作目录的同一道闸校验。规则在loadOrCreateSession里对「Managed 且没有 Related」的会话重新施加一遍,那才是修复既有会话的地方;companion 仍然继承所属对话的目录。 - 从 Management 面板再次打开同一个任务,此前会把会话替换掉而不是回到它:
new_session带related时无条件loadOrCreateSession,在运行中的会话上盖一个新的。有回合在跑时,替换体的引擎只有磁盘历史、running 标志是 false,被遗弃的那个继续跑且不可达,两者各带定时器与保存写入器,谁最后保存谁赢,在途回合从此从磁盘上消失。现在改用其他加载路径都有的那道 map 检查。
GUI:说清楚「在做什么」和「做完了」
- 折叠的工具区是几十次调用,它的标题是这部分工作的全部视野,而它写「3 calls」,既不回答「在做什么」也不回答「还在动吗」——后者就是报告本身:三个点随最后一次调用消失,于是两次调用之间的每个间隙(一轮里大部分实际耗时)都渲染成已完成的标题,盖着一个仍在工作的回合。标题现在每次更新重新推导
calling(在途调用,用它自己卡片的方式命名)、thinking(在跑、区段内没有调用,接上计数免得成了第二个轮次标题)或idle。data-phase也驱动那三个点,.running仍只表示「有调用在途」。finished优先级高于回合,唯一可能留下「标题写着已停阶段」的出口在写标志的地方就处理了。 - 已结束的思考此前一直写着「思考中…」,因为标题只写一次、关闭时只摘 class。现在标题同时带两个词,由 CSS 按块自己的 class 选:流式
session.thinking,关闭后session.thought,导出也用后者(存下来的历史按定义是结束的)。没有文本可供出口重写,也就没有出口会忘记。 - 离开搜索后结果面板留在侧边栏脚下、点它的行没反应:面板是
#session-list的普通子节点,而增量重绘只管.session-group,行还指向一个已经不在跑的搜索。两半是同一个设计错误——搜索答案是sessions帧,于是被存进会话列表,一个匹配子集被交给了所有读这份列表的东西,离开还得靠一次往返。现在结果按 endpoint 各自存,列表从不被碰,退出是本地重绘;帧自己说明装的是哪份列表,「我能作答」在网络握手时就声明,因为老到不标记自己的服务端和一个列表没区别。整个搜索只有一个面板元素(每帧重建正是光标被踢出的原因),只在输入框没有焦点时写;Enter 立即搜或打开高亮行,方向键选择,Escape 离开;每个 endpoint 有 waiting / ok / down / silent 四态,部分答案不可能看起来像完整答案。搜索期间列表停止滚动,否则嵌套滚动容器会让一行在 mousedown 与 mouseup 之间搬走、把点击吞掉。 - 语言切换到不了侧边栏:shell 没有
I18N.onChange处理器,选择器是就地setLocale。Chromium 实测字典答「搜索」而按钮还写 "Search"、整个搜索面板还是英文;现在 shell 重跑那三个拥有外壳 chrome 的渲染。任何「键对齐」测试都看不见它——键存在,只是从来没被重读。角色徽章也不再直接渲染历史里的 token,「user」不会出现在中文面板里,每个徽章还因此有了颜色 class。 - 控制台被 Chromium 的「A form field element should have an id or name attribute」淹没:一个会话页 15 条,开几个编辑器就 99+。它只是 lint,但这么大声的噪音正是真实错误被埋掉的地方。这里的编辑器几乎都在 JS 里搭出来,而 builder 不给它建的东西起名;现在凡元素会重复的地方用
name(name不必唯一,而重复的id本身就是违规)。实测:31 个字段里 15 个无名 → 0 个。 - 表格里的目录芯片会把整张表压变形:一列的宽度取它里面最宽的东西,而单行芯片把路径的无限首选宽度交给了自动布局。现在
max-width: 28ch且换行。值得记下来的是:第一版min(28ch, 100%)限住了芯片却仍让那一列预定整条路径——百分比对着由这条规则自己决定的单元格宽度解析,循环被丢弃、布局退回 max-content,实测 1146px 的消息列仍被占掉 966px。28ch是确定的长度。
开发与验证
- 浏览器检查按进程组杀而不是按进程杀:一次 chromium 启动是十一个进程,其中两个数秒内脱离到 init,没有
Setpgid时它们继承测试二进制的进程组,收尾只能碰到组长。cmd.Wait也取代Process.Wait,抽干拷贝 goroutine,失败日志因此完整。 - WSL 把 core 管道给
/wsl-capture-crash,一个段错误退出的 Chromium 把整个内存镜像写进 Windows 临时目录——实测 87 GB。ulimit -c 0对管道式 dump 无效(man 5 core明说),Chromium 自己的 crash-reporter flags 一个进程都没少;真正管用的是每进程的coredump_filter,由外壳先置 0 再exec,跨 fork 继承覆盖 zygote 与每个渲染器,而exec保住了上一条修复(pid 仍是组长)。 - 两处文档修正,为了让下一个读者不去「修」一个刻意的决定:skills 的脚本从不经过沙箱,因为 skills 存在的意义就是够到被关起来的子进程够不到的东西——权限由它自己的内容决定,边界是 skills 目录而不是沙箱,它拿到的只是卫生措施、不是隔离。
安装
下载对应平台的压缩包,用 checksums.txt 校验后运行(macOS CLI 可执行 install.sh)。