Tinker
Resources
Agent logs
Agent memories
Agent sessions
Agent terminal logs
Agents
Comments
Epics
Projects
Proposals
Tickets
Avo user
Resources
Agent logs
Agent memories
Agent sessions
Agent terminal logs
Agents
Comments
Epics
Projects
Proposals
Tickets
Avo user
Home
Comments
128
Details
128
Go back
Delete
Edit
Id
128
Ticket
Implement smarter context refresh conditional on worker availability
Agent
tinker-reviewer
Content
## Code Review: PASS ### ✅ All Acceptance Criteria Met 1. **ResetContextJob fixed** ✓ - Now uses `AgentCommander.send_message` with proper format `{type: "input", data: "/new"}` - Previous broken format `{command: "/new"}` removed 2. **Context refresh is now conditional** ✓ - Only sends `/new` to `idle` workers with stale sessions (last_activity_at > 30min ago) - Does NOT interrupt actively working agents 3. **Zombie worker detection** ✓ - `cleanup_zombie_workers` method detects `busy` agents with stale activity - Auto-resets zombie workers to `idle` - Configurable via `AGENT_STALE_MINUTES` env var (default 30) 4. **Refresh respects worker state** ✓ - Skips workers with recent activity (< 30 min ago) - Only targets idle workers with stale sessions - Logs all actions for audit trail 5. **MCP tool `refresh_worker_context` exists** ✓ - Available to orchestrator role only - Validates agent is a worker - Validates project scoping - Logs refresh reason 6. **`last_activity_at` tracked** ✓ - Uses existing AgentSession tracking - Checked for staleness detection 7. **Tests cover conditional logic and zombie detection** ✓ - 4 examples in ResetContextJob spec - Covers zombie cleanup, stale/active worker scenarios - All tests pass (4 examples) ### Code Quality **ResetContextJob:** - Clean separation: zombie cleanup first, then refresh - Proper SQL joins to avoid N+1 queries - Good logging for debugging **Agent model:** - `zombie?(minutes)` - clear semantic method - `mark_idle_if_stale!(minutes)` - force cleanup method - `idle_for?(duration)` - utility method **MCP tool:** - Proper authorization (orchestrator only) - Validates worker type and project scoping - Returns success/error responses ### Test Results - ResetContextJob tests: 4 examples, 0 failures ✓ - Agent model tests: 31 examples, 0 failures ✓ - MCP API tests: 39 examples, 0 failures ✓ ### Recommendation: PASS Comprehensive implementation of Option C (Orchestrator-Driven Conditional Refresh + Zombie Detection). The code is well-tested, follows existing patterns, and addresses all requirements in the ticket.
Comment type
code_review
Avo
· © 2026 AvoHQ ·
v3.27.0
Close modal
Are you sure?
Yes, I'm sure
No, cancel