Skip to content

[Bug] Hive Integration Uses Deprecated Playground Endpoints - Should Use AgentOS v2 Routes #16

@vasconceloscezar

Description

@vasconceloscezar

Bug Description

The AutoMagik Hive integration in automagik_spark/core/workflows/automagik_hive.py is using deprecated Agno v1 Playground endpoints that no longer exist in the current Hive implementation.

AutoMagik Hive has migrated from Agno v1 Playground to Agno v2 AgentOS, but Spark's integration code still references the old /playground/* routes.

Steps to Reproduce

  1. Review automagik_spark/core/workflows/automagik_hive.py

  2. Observe usage of deprecated endpoints:

    • /playground/status (lines 98-124)
    • /playground/agents (line 148)
    • /playground/teams (line 198)
    • /playground/workflows (line 249)
    • /playground/agents/{id}/runs (line 401)
    • /playground/teams/{id}/runs (line 428)
    • /playground/workflows/{id}/runs (line 466)
  3. Check Hive's actual API implementation in automagik-hive/api/serve.py

  4. Observe that AgentOS auto-generates routes without /playground/ prefix

Expected Behavior

Spark should use the current AgentOS v2 endpoints:

  • /api/v1/health - Health check (exists in api/routes/health.py)
  • /agents - List/manage agents
  • /teams - List/manage teams
  • /workflows - List/manage workflows
  • /agents/{id}/runs - Execute agent
  • /teams/{id}/runs - Execute team
  • /workflows/{id}/runs - Execute workflow

Actual Behavior

Spark attempts to call deprecated /playground/* endpoints that don't exist, causing integration failures.

Environment

  • Affected File: automagik_spark/core/workflows/automagik_hive.py
  • Test File: tests/core/workflows/test_automagik_hive.py
  • AutoMagik Hive Version: Agno v2 (AgentOS)
  • AutoMagik Spark Version: 0.2.2

Impact

High - Hive integration is currently broken due to endpoint mismatch

Required Changes

1. Update Endpoint URLs (Simple Find/Replace)

# BEFORE (Deprecated)
/playground/agents/agents
/playground/teams/teams
/playground/workflows/workflows
/playground/agents/{id}/runs/agents/{id}/runs
/playground/teams/{id}/runs/teams/{id}/runs
/playground/workflows/{id}/runs/workflows/{id}/runs

2. Fix Health/Status Check (Lines 88-136)

# BEFORE (Incorrect - uses config endpoint)
status_response = await client.get("/playground/status")

# AFTER (Correct - use dedicated health endpoint)
health_response = await client.get("/api/v1/health")
health_data = health_response.json()
# Returns: {"status": "success", "service": "Automagik Hive Multi-Agent System", ...}

Note: Do NOT use /api/v1/agentos/config for health checks - use /api/v1/health

3. Update Tests

  • Update tests/core/workflows/test_automagik_hive.py to mock correct endpoints
  • Add integration test with live Hive instance if possible

4. Verify Response Formats

  • AgentOS may return slightly different response structures
  • Validate that response parsing still works correctly

Affected Areas

  • Hive Integration
  • Workflows
  • Testing

Possible Solution

  1. Replace all /playground/ prefixes with / (except health endpoint which uses /api/v1/health)
  2. Update validate() method to use proper health endpoint
  3. Test against running Hive instance on port 8886
  4. Update integration tests
  5. Verify authentication still works (should - uses x-api-key header)

Additional Context

  • Hive API Key: Available in ../automagik-hive/.env as HIVE_API_KEY
  • Hive Port: 8886
  • Reference: Hive's api/serve.py lines 537-651 show AgentOS initialization
  • Reference: Hive's api/routes/health.py shows correct health endpoint

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:highHigh - Important, should be addressed soonstatus:needs-triageNeeds Triage - Awaiting initial reviewtype:bugBug - Something isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions