1. Standardize ctl dispatch: hoist rootCtlHandlers and sessionCtlHandlers to package-level vars, matching the agent pattern. 2. Fix error wrapping: %v → %w in toolsrv/shell.go (only 2 instances; backend/ was already clean). 3. Canonicalize tool server access: LoadTool now only uses session.ToolsConn() — removed fallback to agent.ToolServer(). 4. Centralize event handler wiring: wireAgentEvents(sessID, ag, al) replaces separate SetOutput + wireAgentStateEvents calls. Documents the contract. 5. Split toolsrv/shell.go: validation patterns, ValidateCode, and rate limiting moved to shell_validate.go (86 lines). shell.go retains execution logic (594 lines). |
||
|---|---|---|
| .. | ||
| event.go | ||
| persist.go | ||
| registry.go | ||
| session.go | ||
| setup.go | ||