Skip to content

fix: Add safety check for workspace agent verification failures#121

Merged
khaliqgant merged 2 commits intomainfrom
fix/workspace-update-agent-detection
Jan 9, 2026
Merged

fix: Add safety check for workspace agent verification failures#121
khaliqgant merged 2 commits intomainfrom
fix/workspace-update-agent-detection

Conversation

@agent-relay-rachel
Copy link
Copy Markdown
Contributor

Summary

  • Add verified flag to checkActiveAgents() to distinguish between "no agents" and "unable to verify"
  • Skip workspace updates when agent status cannot be verified (unless force flag is set)
  • Add diagnostic logging to capture raw agent status values for debugging

Problem

When checkActiveAgents() couldn't reach a workspace (network error, timeout), it returned hasActiveAgents: false, causing gracefulUpdateImage() to proceed with restarts even when agents might actually be running.

Changes

  • checkActiveAgents(): Returns new verified: boolean field
    • true: Successfully verified agent status
    • false: HTTP error, network error, or timeout
  • gracefulUpdateImage(): Skips update when verified=false (unless force flag)
  • UpdateResult: New SKIPPED_VERIFICATION_FAILED status
  • Diagnostic logging: Captures raw agent status values before/after filtering
  • Summary: Includes skippedVerificationFailed count

Test plan

  • Verify unreachable workspaces are skipped (not force-restarted)
  • Verify active agents still prevent restart
  • Verify force flag overrides both conditions
  • Review diagnostic logs to confirm raw status capture

🤖 Generated with Claude Code

Agent Relay and others added 2 commits January 9, 2026 15:53
Problem:
When checkActiveAgents() couldn't reach a workspace (network error, timeout),
it returned hasActiveAgents: false, causing gracefulUpdateImage() to proceed
with restarts even when agents might actually be running.

Changes:
- Add `verified: boolean` field to checkActiveAgents() return type
- Return verified: false on HTTP errors and catch block (network failures)
- Add SKIPPED_VERIFICATION_FAILED to UpdateResult enum
- Update gracefulUpdateImage() to skip update when verified=false (unless force)
- Add diagnostic logging to capture raw agent status values for debugging
- Update summary to include skippedVerificationFailed count

This prevents unsafe restarts of workspaces where we cannot verify agent status.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The 'broadcasts to all leads' integration test was failing on macOS
with Node.js 20 due to a 100ms timeout being insufficient for message
delivery. Increased to 300ms to match the pattern used by the similar
'sends message to lead by alias' test in the same file.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@khaliqgant khaliqgant merged commit 9dd4a13 into main Jan 9, 2026
6 checks passed
@khaliqgant khaliqgant deleted the fix/workspace-update-agent-detection branch January 9, 2026 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant