Skip to content

Kore Step 3: Extract OpenAI chat completions provider path #5

Description

@aj-nt

Task

Extract the OpenAI chat completions provider path from run_agent.py into agent/kore/providers/openai_compat.py.

This is the simplest, most common provider path and the largest single win in the extraction plan.

Current State

  • Steps 0-1 completed: agent/kore/config.py and agent/sanitization.py extracted
  • Steps 2 partially done: several helper modules extracted (glm_heuristic, think_blocks, provider_headers, error_utils, tool_calls, responses_api, vision_utils, client_lifecycle, display_utils, reasoning, url_helpers, message_prep)
  • run_agent.py at 11,666 lines (from 12,880 original)
  • 368 kore+memory+session_search+recent_context tests pass, 165 hermes_state tests pass

Approach

  • AIAgent delegates its OpenAI client construction and streaming to the new module
  • Delete the inline code immediately (Fowler Strangler Fig — no parallel paths)
  • Existing test suite provides coverage
  • Commit to dogfood branch

Reference

See plan: 庫/Agent-Hermes/plans/kore-agent-core-replacement.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestkoreKore agent core extraction/refactoring

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions