Skip to content

docs: add Codex and Claude Harness examples and a codex runtime-image conref - #566

Open
chinmaychahar wants to merge 2 commits into
kagent-dev:mainfrom
chinmaychahar:docs/harness-codex-claude-examples
Open

chinmaychahar wants to merge 2 commits into
kagent-dev:mainfrom
chinmaychahar:docs/harness-codex-claude-examples

Conversation

@chinmaychahar

@chinmaychahar chinmaychahar commented Oct 7, 2026 •

Copy link
Copy Markdown

Closes #530

Adds Codex and Claude Harness examples to agents/agent-harness.md and a runtime-image-codex conref that the ref-docs job resolves

Placement: both examples go on the harness page, next to the existing example and the runtime tables, so a reader can compare the runtimes in one place. Open to suggestions.

Done when

  • Codex Harness example with its ModelConfig and an AgentTemplate, run on a cluster
  • Claude Harness example on the same terms
  • runtime-image-codex.md exists and resolves; the other two conrefs still resolve
  • runtime-image-claude.md is referenced by a page again
  • Every image is digest-pinned
  • Placement question answered

Testing

On kind with kagent 1.0.0-alpha8, both Agents reach Ready and Sessions start. A Codex ModelConfig without apiFormat: responses is rejected. I haven't run a real model turn because I don't have keys. @Rachael-Graham, could you run one with your OpenAI key?

UI


01-agents

Signed-off-by: chinmaychahar <chinmay.cc.06@gmail.com>
Signed-off-by: chinmaychahar <chinmay.cc.06@gmail.com>
@chinmaychahar
chinmaychahar marked this pull request as ready for review October 8, 2026 15:37

@Rachael-Graham Rachael-Graham left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran both examples on a kind cluster running kagent 1.0.0-alpha8 with Agent Substrate 0.4.0-alpha1, applied exactly as the page renders them.

Codex. All three resources are accepted, the Agent reports Accepted, ResolvedRefs, Compatible and Ready with no warnings, the Session reaches RUNTIME_STATE_READY, and a turn returns the model's reply. The manifest is correct as written.

Claude. Same four conditions, no warnings, and the Session starts and reaches the Anthropic API. I have no Anthropic key, so the turn itself ends at Invalid API key · Fix external API key — everything up to the model call is verified, the model call is not.

Also checked: both manifests pass the alpha8 CRD schemas with no unknown or missing fields and every CEL rule satisfied, the digest you pinned is the one GHCR serves for codex-harness:1.0.0-alpha8, the Secret names and keys match the OpenAI and Anthropic guides, both provider links and the #model-provider-support anchor resolve in a local build, and the page builds clean with both tabs rendering.

The deploy check fails because a pull request from a fork cannot read CLOUDFLARE_API_TOKEN. Nothing for you to fix.

Comments inline.


### Codex and Claude examples

A `codex` or `claude` Harness has the same shape as a `kagent` one. It differs only in the runtime block, the image, and the ModelConfigs that it accepts. For the providers and settings that each runtime accepts, see [Model provider support](#model-provider-support).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"It differs only in" contradicts Tool and skill support further down this page, where both runtimes also constrain what an AgentTemplate can bind.

Suggested change
A `codex` or `claude` Harness has the same shape as a `kagent` one. It differs only in the runtime block, the image, and the ModelConfigs that it accepts. For the providers and settings that each runtime accepts, see [Model provider support](#model-provider-support).
A `codex` or `claude` Harness has the same shape as a `kagent` one, and differs in the runtime block, the image, and the ModelConfigs that it accepts. For the providers and settings that each runtime accepts, see [Model provider support](#model-provider-support), and for the limits each one places on an AgentTemplate, see [Tool and skill support](#tool-and-skill-support).


{{< tabs >}}
{{% tab name="Codex" %}}
The ModelConfig reads its API key from the `kagent-openai` Secret that the [OpenAI]({{< link path="setup/model-providers/openai" >}}) guide creates.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A key that cannot reach gpt-5.2-codex compiles and starts a Session, then fails the turn with nothing but Codex execution failed. Say so, and anchor the link to the section that creates the Secret.

Suggested change
The ModelConfig reads its API key from the `kagent-openai` Secret that the [OpenAI]({{< link path="setup/model-providers/openai" >}}) guide creates.
The ModelConfig reads its API key from the `kagent-openai` Secret that the [OpenAI]({{< link path="setup/model-providers/openai#create-the-modelconfig" >}}) guide creates. The key must be entitled to the model that you name. A key without access to it fails the turn with `Codex execution failed`.

```
{{% /tab %}}
{{% tab name="Claude" %}}
The ModelConfig reads its API key from the `kagent-anthropic` Secret that the [Anthropic]({{< link path="setup/model-providers/anthropic" >}}) guide creates.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anchor the link to the section that creates the Secret, so the reader lands on the step.

Suggested change
The ModelConfig reads its API key from the `kagent-anthropic` Secret that the [Anthropic]({{< link path="setup/model-providers/anthropic" >}}) guide creates.
The ModelConfig reads its API key from the `kagent-anthropic` Secret that the [Anthropic]({{< link path="setup/model-providers/anthropic#create-the-modelconfig" >}}) guide creates.

RUNTIME_IMAGES="runtime-image:kagent-dev/kagent/golang-adk
runtime-image-claude:kagent-dev/kagent/claude-harness"
runtime-image-claude:kagent-dev/kagent/claude-harness
runtime-image-codex:kagent-dev/kagent/codex-harness"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment block at L435-452 still says two conrefs hold a digest, and names only golang-adk and claude-harness. Add codex-harness there — that paragraph is the only thing stopping the next person reaching for the unpublished codex-adk.


The `kagent` and `byo` runtimes compile through the same path, so they accept the same model providers and the same AgentTemplate features, except [structured output]({{< link path="agents/structured-output" >}}), which only the `kagent` runtime supports. The `codex` and `claude` runtimes are purpose-built adapters, and each accepts a narrower slice.

### Codex and Claude examples

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit, and it answers your placement question: this page is the right home and both runtimes belong together. Move the section below ### Runtime-specific settings so Choose a runtime reads table, prose, settings, then the worked examples.

model: gpt-5.2-codex
provider: OpenAI
openAI:
# The only value that the codex runtime accepts.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this restates the codex with OpenAI row of the restriction table that the section already links to. Drop it.

name: codex-agent
namespace: kagent
spec:
template:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this inlines spec.template, while every other 1.x example uses templateRef with a separate AgentTemplate, and your description says AgentTemplate. Both are valid — pick one so the tree reads consistently.

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.

Docs: add Codex and Claude Harness examples, and a codex runtime-image conref

2 participants