Skip to content

Modularize agent interpreter provider into focused application modules#138

Open
danielbdyer wants to merge 1 commit into
mainfrom
codex/refactor-agent-interpreter-into-modules
Open

Modularize agent interpreter provider into focused application modules#138
danielbdyer wants to merge 1 commit into
mainfrom
codex/refactor-agent-interpreter-into-modules

Conversation

@danielbdyer
Copy link
Copy Markdown
Owner

Motivation

  • Break up the large agent-interpreter-provider implementation into focused, testable pieces to improve separation of concerns, make provider variants pluggable, and enable incremental migration.
  • Surface a stable compatibility shim so callers continue to work while the new package is adopted.

Description

  • Extracted the agent interpreter implementation into a new package lib/application/agent-interpreter/ with these modules: contract.ts, factory.ts, resilience.ts, ab-testing.ts, and providers/{disabled,heuristic,llm-api,session}.ts to encapsulate provider wiring, retries/timeouts, A/B routing, and concrete providers.
  • Added a thin compatibility shim at lib/application/agent-interpreter-provider.ts that re-exports resolveAgentInterpreterProvider, DEFAULT_AGENT_INTERPRETER_CONFIG, resilience helpers, and scoped provider constructors for incremental migration.
  • Updated application docs (lib/application/README.md) and regenerated the module map so the new layout is discoverable.
  • Added focused tests: tests/agent-interpreter-factory.spec.ts, tests/agent-interpreter-heuristic.spec.ts, tests/agent-interpreter-resilience.spec.ts, and tests/agent-interpreter-provider.integration.spec.ts covering factory precedence, fallback semantics, heuristic determinism, timeout fallback behavior, and an end-to-end LLM parsing integration.

Testing

  • Ran npm run map to refresh module discoverability; the command completed successfully.
  • Ran targeted Playwright tests for the new modules with npx playwright test against the new interpreter tests and related resilience/resource tests; the newly added tests and the related resource/resilience suites passed (all targeted tests succeeded).
  • Ran npm run check; typecheck failed due to pre-existing, unrelated baseline diagnostics in other tests (not introduced by this refactor).

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant