zot/internal/agent
patriceckhart 744685d68d fix(extensions): close ext.commands / ext.tools / lastFrameTime races
CI's `go test -race` flagged two races introduced over the recent
extension work:

1. ext.commands / ext.tools were appended to from the read-loop
   goroutine without a lock, while Commands() / Tools() / HasCommand
   read them under m.mu. Same for the toolIndex pre-check. Fix:
   take m.mu around the appends and the index dedup so writers and
   readers serialise on the same lock.

2. assumeReadyAfterIdle read ext.lastFrameTime once on entry without
   the per-extension lock (the read inside the loop already had it).
   Fix: take ext.mu for the initial snapshot too.

Verified locally with `go test -race ./...`; all packages pass.
The corresponding CI run for the scratchpad-persistence commit
failed for exactly these two races on linux + macos.
2026-04-19 15:27:09 +02:00
..
extensions fix(extensions): close ext.commands / ext.tools / lastFrameTime races 2026-04-19 15:27:09 +02:00
modes feat: skills — reusable instructions discovered from SKILL.md files 2026-04-19 14:32:30 +02:00
tools initial commit 2026-04-17 20:36:38 +02:00
args.go feat(extensions): --ext PATH (short -e) for ad-hoc loading 2026-04-19 15:20:56 +02:00
botcmd.go fix ci on windows: split detach helper into posix/windows variants 2026-04-18 10:58:10 +02:00
botcmd_unix.go fix ci on windows: split detach helper into posix/windows variants 2026-04-18 10:58:10 +02:00
botcmd_windows.go fix ci on windows: split detach helper into posix/windows variants 2026-04-18 10:58:10 +02:00
build.go feat(extensions): phase 2 — extension-defined tools 2026-04-19 14:46:32 +02:00
cli.go feat(extensions): --ext PATH (short -e) for ad-hoc loading 2026-04-19 15:20:56 +02:00
config.go add telegram bot bridge 2026-04-18 09:15:46 +02:00
extcmd.go feat: extension system (subprocess + json-rpc, any language) 2026-04-19 14:09:43 +02:00
modelsync.go initial commit 2026-04-17 20:36:38 +02:00
rpc.go feat(extensions): --ext PATH (short -e) for ad-hoc loading 2026-04-19 15:20:56 +02:00
systemprompt.go initial commit 2026-04-17 20:36:38 +02:00
update.go tui: show 'update available' banner at top of chat 2026-04-18 11:49:22 +02:00