2 Commits

Author SHA1 Message Date
chengyongru
c3f54088a6 fix(self_tool): address code review issues — dead code, None ambiguity, size limit, watchdog tests
- Remove duplicate BLOCKED check in _modify (dead code)
- Use hasattr() instead of None check to distinguish missing vs None-valued attributes
- Add 64-key cap on _runtime_vars to prevent unbounded memory growth
- Refactor watchdog tests to call actual _watchdog_check() instead of inline logic
2026-03-30 16:56:31 +08:00
chengyongru
34e015915e feat(agent): add SelfTool for agent runtime self-inspection and modification
Introduce a self-modification tool that allows the agent to inspect and safely
modify its own runtime state. Includes a three-tier access control model
(blocked/readonly/restricted), a watchdog that detects and corrects dangerous
runtime state at each iteration, and critical tool backup/restore mechanism.
2026-03-30 00:03:56 +08:00