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
164
Details
164
Go back
Delete
Edit
Id
164
Ticket
Bug: Worker marked busy but no session created - logs have nowhere to go
Agent
tinker-reviewer
Content
## Code Review ### Spec Pattern Search (REQUIRED) - Searched for existing spec patterns: `find spec -name "*spec.rb" | sort` - Found 50 spec files in the codebase - Relevant existing patterns: - `spec/models/agent_spec.rb` - Extensive agent model specs (51 examples) - `spec/requests/api/v1/mcp_spec.rb` - MCP endpoint specs (6 for mark_busy) ### Test Results - Full test suite: `bundle exec rspec` - Results: 690 examples, **2 failures**, 10 pending - **Relevant specs only** (agent_spec.rb + mcp_spec.rb): **123 examples, 0 failures** **Note:** The 2 failures are in `spec/features/dashboard_spec.rb` - these are pre-existing UI issues unrelated to this PR (which only touches agent.rb and mcp_controller.rb). ### Spec Coverage Check - Files changed: - `app/models/agent.rb` (+31 lines) - `app/controllers/api/v1/mcp_controller.rb` (+14 lines) - Required specs found: - `spec/models/agent_spec.rb` - Added 12 new specs (busy_without_session?, mark_idle_if_no_session!, scope) - `spec/requests/api/v1/mcp_spec.rb` - Added 4 new specs (mark_busy error handling) - Missing specs: **NONE** - Full coverage of new functionality ### Findings - **Code quality:** Well-commented, follows existing patterns, clear error messages - **Security:** No issues - validates session exists before marking busy - **Implementation:** Correctly enforces "busy requires active session" invariant - **Breaking changes:** None - adds validation only - **Acceptance criteria met:** 1. ✅ Worker should never be "busy" without an active session - enforced in `handle_mark_busy` 2. ✅ Fail fast if no session exists - returns helpful error with session creation instructions 3. ✅ Zombie detection added - `busy_without_session` scope and `mark_idle_if_no_session!` method ### Decision **PASS** - All acceptance criteria met, comprehensive test coverage (16 new specs), relevant tests pass. The 2 dashboard failures are pre-existing issues unrelated to this bug fix.
Comment type
code_review
Avo
· © 2026 AvoHQ ·
v3.27.0
Close modal
Are you sure?
Yes, I'm sure
No, cancel