Skip to content

Add API provider selection and Codex skills#2

Open
arsis-dev wants to merge 1 commit into
CL-ML:mainfrom
arsis-dev:api-providers
Open

Add API provider selection and Codex skills#2
arsis-dev wants to merge 1 commit into
CL-ML:mainfrom
arsis-dev:api-providers

Conversation

@arsis-dev
Copy link
Copy Markdown

Summary

Adds provider selection to API mode and ships Codex-compatible agent skills for the existing Open Collider setup/brainstorm workflow.

Anthropic remains the default provider. Existing projects keep working unchanged unless they opt into llm_provider: openai or llm_provider: codex.

What changed

  • Added llm_provider support for API mode:
    • anthropic remains the default.
    • openai uses the OpenAI Responses API shape.
    • codex shells out to local codex exec.
  • Added provider-prefixed model names, for example:
    • anthropic:claude-sonnet-4-20250514
    • openai:gpt-4.1
    • codex:default
  • Added early validation for mismatched provider/model configs, such as using unprefixed Claude models with llm_provider: openai.
  • Added optional per-phase token caps:
    • domain_max_tokens
    • generation_max_tokens
    • scoring_max_tokens
  • Added .agents/skills/open-collider-setup and .agents/skills/open-collider-brainstorm as Codex equivalents for the existing Claude Code /collider_setup and /brainstorm flows.
  • Added two small Codex skill helper scripts:
    • run_iteration.py to invoke the existing Python orchestrator.
    • apply_flags_from_text.py to map human love/like/trash input back to idea IDs deterministically.
  • Updated README, .env.example, and project template comments with provider examples.
  • Improved score parsing for aggregate scores written as **4.25/5**.

Why

Open Collider already has two execution surfaces:

  • skill mode, where Claude Code orchestrates the workflow;
  • API mode, where Python orchestrates LLM calls through Anthropic.

This PR keeps that architecture, but makes API mode usable from more environments:

  • users with Anthropic keys can continue using the default flow;
  • users with OpenAI or a local OpenAI Responses-compatible server can run the same Python orchestrator;
  • Codex users can run the same setup and brainstorm workflow without needing Claude Code slash commands.

The Codex provider is intentionally marked experimental because each LLM call starts a local codex exec process. It is useful for local agent workflows and testing, while direct API providers remain the better fit for faster and more deterministic runs.

Codex skill scripts

The Codex skills include two small helper scripts so the agent workflow can call the existing Python API-mode orchestration without reimplementing it in prompt text.

  • .agents/skills/open-collider-brainstorm/scripts/run_iteration.py

    • Runs one API-mode brainstorm iteration for a project.
    • Accepts an optional --brainstorm-id to resume a specific brainstorm.
    • Imports BrainstormOrchestrator from the repository and prints the iteration result as JSON.
    • Purpose: gives Codex a stable command equivalent to the execution step of /brainstorm.
  • .agents/skills/open-collider-brainstorm/scripts/apply_flags_from_text.py

    • Parses user-friendly flag text such as love 1,3 - like 2 - trash the rest.
    • Resolves display numbers through numbering_map.json.
    • Calls the existing apply_flags() function and regenerates reports through the existing report path.
    • Purpose: keeps the love/like/trash loop deterministic instead of asking the agent to manually map displayed numbers to idea IDs.

Both scripts are thin adapters around existing Open Collider functions. They do not introduce new LLM behavior; they make the Codex skill workflow reproducible from terminal commands.

Compatibility

  • Default behavior remains Anthropic.
  • No new base dependency is added.
  • OpenAI support uses the existing optional API dependency path.
  • The prepare/parse layer remains independent from llm/ and brainstorm.py, so skill mode is not coupled to API mode.
  • This PR does not include the HTML report changes from the companion report PR.

Tests

PYTHONPATH=src .venv/bin/python -m pytest tests/ -v

Result: 36 passed

Targeted lint:

PYTHONPATH=src .venv/bin/python -m ruff check src/open_collider/brainstorm.py src/open_collider/llm/client.py src/open_collider/scoring/data_loader.py src/open_collider/scoring/score_parser.py tests/test_api_mode.py tests/test_smoke.py .agents/skills/open-collider-brainstorm/scripts/apply_flags_from_text.py .agents/skills/open-collider-brainstorm/scripts/run_iteration.py

Result: All checks passed

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