Skip to content

feat(harnesses): Pass run context to agent factories#55

Merged
dcramer merged 1 commit into
mainfrom
codex/contextual-agent-factories
May 4, 2026
Merged

feat(harnesses): Pass run context to agent factories#55
dcramer merged 1 commit into
mainfrom
codex/contextual-agent-factories

Conversation

@dcramer
Copy link
Copy Markdown
Member

@dcramer dcramer commented May 4, 2026

Agent factories in the first-party harnesses now receive the eval input and harness context before the harness instruments tools or executes the run. This lets per-run agents derive instructions, tool closures, metadata, and artifacts without AsyncLocalStorage or other side-channel setup.

Contextual Factories

OpenAI Agents and Pi AI create their agents before native tool instrumentation, so createAgent now receives { input, context } in both harnesses. AI SDK agent factories receive the same shape for consistency and lower boilerplate.

Docs And Policy

Update harness READMEs, skill references, and the API design policy so future harness surfaces prefer one contextual per-run factory object.

Validated with pnpm exec biome lint, pnpm exec vitest run for the three harness test files, pnpm run typecheck, and pnpm run build.

Fixes #54

Let first-party harness agent factories receive the eval input and harness context before instrumentation or execution. This keeps input-dependent agents on the native replay path without side-channel setup.

Fixes GH-54

Co-Authored-By: OpenAI Codex <codex@openai.com>
@dcramer dcramer marked this pull request as ready for review May 4, 2026 19:34
@dcramer dcramer merged commit e2b8785 into main May 4, 2026
9 checks passed
@dcramer dcramer deleted the codex/contextual-agent-factories branch May 4, 2026 19:41
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.

OpenAI Agents harness: pass run args to createAgent

1 participant