Skip to content

Conversation

devin-ai-integration[bot]
Copy link
Contributor

Convert agent lookup endpoint to use query parameters

Summary

This PR converts the GET /v1/agent/lookup endpoint from using request body parameters to query parameters, along with updating the Python SDK to match. This addresses the inconsistency where a GET endpoint was requiring a request body, which is not RESTful best practice.

Changes made:

  • Backend (vlm-lab): Modified lookup_agent functions in both main and local execution routes to accept name, version, and id as FastAPI Query parameters instead of an AgentLookupRequest body
  • Python SDK (vlmrun-python-sdk): Updated the agent.get() method to send parameters via the params argument instead of data (request body)
  • Validation logic: Preserved all existing validation (only one of id or name can be provided)
  • Response format: Completely unchanged - still returns AgentInfoResponse

Review & Testing Checklist for Human

  • End-to-end API testing: Test the actual /v1/agent/lookup endpoint with both lookup methods (by id and by name+version) to ensure it works correctly with query parameters
  • Python SDK integration: Verify the updated Python SDK can successfully call the new endpoint and receives the expected responses
  • Validation behavior: Confirm error handling still works identically (test with invalid combinations like both id and name provided)
  • Other client compatibility: Verify that the Node SDK and any other internal clients still work (Node SDK was mentioned as already using query params correctly)
  • Deployment coordination: Since this is a breaking change, confirm the deployment strategy - both changes need to go live together or a migration plan is needed

Recommended test plan:

  1. Deploy the backend changes to a test environment
  2. Test the endpoint directly with curl/Postman using query parameters
  3. Run the Python SDK against the updated endpoint
  4. Verify the Node SDK and any other clients still function
  5. Test edge cases (missing params, invalid combinations, special characters in agent names)

Diagram

%%{ init : { "theme" : "default" }}%%
graph TB
    Client["Python SDK<br/>agent.get()"]:::major-edit
    API["GET /v1/agent/lookup<br/>FastAPI Endpoint"]:::major-edit
    LocalAPI["Local Agent Lookup<br/>agent_executions_local.py"]:::major-edit
    MainAPI["Main Agent Lookup<br/>agent_executions.py"]:::major-edit
    
    LookupByName["lookup_agent_by_name()"]:::context
    LookupById["lookup_agent_by_id()"]:::context
    AgentDB["Agent Database"]:::context
    
    Client -->|"params={id: ..., name: ..., version: ...}"| API
    API --> MainAPI
    LocalAPI --> MainAPI
    MainAPI --> LookupByName
    MainAPI --> LookupById
    LookupByName --> AgentDB
    LookupById --> AgentDB
    
    subgraph Legend
        L1[Major Edit]:::major-edit
        L2[Minor Edit]:::minor-edit  
        L3[Context/No Edit]:::context
    end
    
    classDef major-edit fill:#90EE90
    classDef minor-edit fill:#87CEEB
    classDef context fill:#FFFFFF
Loading

Notes

  • This is a breaking API change that requires coordinated deployment of both backend and SDK changes
  • The Node SDK was mentioned as already using query parameters correctly, so it should continue working without changes
  • The AgentLookupRequest model in the backend can remain for potential future use, but is no longer used by this endpoint
  • Query parameters are more appropriate for GET requests and align with REST best practices

Link to Devin run: https://app.devin.ai/sessions/96cc0272ee1649f3bacf73bd022c4c53
Requested by: @Mirajul-Mohin

- Change agent.get() method to send name, version, id as query params
- Update APIRequestor call to use params instead of data
- Maintain same validation logic and response handling

Co-Authored-By: [email protected] <[email protected]>
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

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