Skip to content

Feature: Implement gRPC/HTTP LLM Client for Live Agent AST Generation #10

@dk-uppi-aks

Description

@dk-uppi-aks

Describe the Feature

Currently, the dynamic capability synthesis (Agentic Forge) fails during live execution because the LLM generation dispatcher in orchestrator.rs:L78 is a stub that immediately returns an error:

pub fn dispatch_agent_generation(_prompt: &str) -> Result<Value, String> {
    Err("Agent dispatch via Python subprocess removed to comply with Data Plane Prohibition. Please implement gRPC LLM client.".to_string())
}

This issue proposes replacing this stub with a fully functioning gRPC or HTTP LLM client to query Gemini or OpenAI-compatible models directly from the Rust backend.

Proposed Architecture & Requirements

  1. Client Implementation:
    • Implement the client within crates/codegen (which already depends on reqwest).
    • Support environment-driven configuration (e.g., checking for GEMINI_API_KEY, OPENAI_API_KEY, OPENAI_API_BASE, or OPENAI_MODEL).
  2. Response Cleanup:
    • Parse the JSON response payload.
    • Clean/strip markdown syntax wrapping (e.g., ```python ... ``` blocks) from the returned completion text to output clean code.
  3. Validation:
    • Pass the cleaned payload back into the existing validation engine (validate_generated_code) to assert that the generated AST conforms to the requested target schema.
  4. Testing:
    • Introduce an integration test in the test-suite that checks for the presence of these environment variables, calls the live client, and verifies successful code synthesis.

Implementation Checklist

  • Implement dispatch_agent_generation HTTP/gRPC client in orchestrator.rs.
  • Add support for reading environment-based model credentials.
  • Add response scrubbing logic.
  • Add functional tests to crates/test-suite/tests/unit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions