picoclaw/pkg
Administrator 3c2d373a5c fix(agent): resolve race conditions and resource leaks in SubTurn
Critical fixes (5):
- Fix turnState hierarchy corruption in nested SubTurns by checking context
  before creating new root turnState in runAgentLoop
- Fix deadlock risk in deliverSubTurnResult by separating lock and channel ops
- Fix session rollback race in HardAbort by calling Finish() before rollback
- Fix resource leak by closing pendingResults channel in Finish() with recovery
- Add thread-safety docs for childTurnIDs and isFinished fields

Medium priority fixes (5):
- Move globalTurnCounter to AgentLoop.subTurnCounter to prevent ID conflicts
- Improve semaphore acquisition to ensure release even on early validation failures
- Document design choice: ephemeral sessions start empty for complete isolation
- Add final poll before Finish() to capture late-arriving SubTurn results
- Remove duplicate channel registration in spawnSubTurn to fix timing issues

Testing:
- Add 6 new tests covering hierarchy, deadlock, ordering, channel lifecycle,
  final poll, and semaphore behavior
- All 12 SubTurn tests passing with race detector

This resolves 10 critical and medium issues (5 race conditions, 2 resource leaks,
3 timing issues) identified in code review, bringing SubTurn to production-ready state.
2026-03-16 22:54:01 +08:00
..
agent fix(agent): resolve race conditions and resource leaks in SubTurn 2026-03-16 22:54:01 +08:00
auth feat(auth): add Anthropic OAuth setup-token login (#926) 2026-03-06 19:58:23 +08:00
bus Removed the old heavy logic 2026-03-08 18:22:15 +01:00
channels fix(qq): populate account bindings metadata (#1456) 2026-03-13 23:08:55 +08:00
commands feat: add /clear command to clear chat history (#1266) 2026-03-09 16:39:33 +08:00
config feat(agent): steering (#1517) 2026-03-16 00:08:16 +08:00
constants refactor: replace bool map with set-style map for internal channels (#472) 2026-02-19 11:48:17 +01:00
cron feat(cron): add execution lifecycle logging (#1185) 2026-03-06 20:46:52 +08:00
devices refactor: cleanup dead code and turn on dead code detection in CI (#515) 2026-02-24 21:52:25 +08:00
fileutil refactor(pkg): move atomic file write to dedicated fileutil package 2026-02-24 23:57:13 +08:00
health chore: resolve conflicts with upstream/main 2026-02-28 12:21:54 +08:00
heartbeat enable dupl check 2026-03-01 18:17:32 +11:00
identity fix(identity): prevent allowlist ID entries from matching usernames (#1406) 2026-03-13 15:41:18 +08:00
logger make gateway aware of config.json change (#1187) 2026-03-13 14:27:46 +08:00
mcp Feat/add tool enable or disable configuration (#1071) 2026-03-05 14:53:26 +08:00
media chore: resolve conflicts with upstream/main 2026-02-28 12:21:54 +08:00
memory fix: skip meta json files during session migration (#1340) 2026-03-11 14:29:42 +08:00
migrate docs: remove stale TOOLS.md references (#1388) 2026-03-12 09:47:01 +08:00
providers feat: add anthropic-messages protocol for native Anthropic Messages API support Fixes #269 (#1284) 2026-03-13 14:09:40 +08:00
routing fix(routing): address review feedback on CJK estimation and observability 2026-03-06 13:10:20 +08:00
session fix(security): harden unauthenticated tool-exec paths (#1360) 2026-03-11 19:22:20 +08:00
skills enhance skill installer (#1252) 2026-03-13 14:04:02 +08:00
state fix(security): harden unauthenticated tool-exec paths (#1360) 2026-03-11 19:22:20 +08:00
tools feat(agent): wire SubTurn into AgentLoop and Spawn Tool 2026-03-16 20:44:04 +08:00
utils enhance skill installer (#1252) 2026-03-13 14:04:02 +08:00
voice Fix lint 2026-03-04 10:21:59 +00:00