awslabs / awslabs/agentcore-samples

Add a Codex on AgentCore Runtime with EFS sample under 12-coding-agents

Open
#1,837 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
3.4k
Forks
1.3k
Avg merge
1d 22h
Merged PRs (30d)
30

Description

Currently `06-workshops/01-AgentCore-runtime/12-coding-agents` contains two Claude Code samples (`01-claude-code-with-s3-files`, `02-claude-code-with-efs`). There is no sample covering the OpenAI Codex SDK on AgentCore Runtime.

Codex is not a drop-in substitution for Claude Code in the existing EFS sample. The setup differs in ways that are easy to get wrong and are worth documenting:

- Codex reads its provider configuration from `$CODEX_HOME/config.toml` (`model_provider = "amazon-bedrock"`). There is no equivalent of the `CLAUDE_CODE_USE_BEDROCK=1` env var.
- The GPT-5.6 family (`openai.gpt-5.6-sol` and siblings) is served through the `bedrock-mantle` endpoint, so the execution role needs `bedrock-mantle:CreateInference` and `bedrock-mantle:CallWithBearerToken` rather than only `bedrock:InvokeModel`.
- Because `CODEX_HOME` can live on EFS, a Codex *thread* becomes persistent state rather than session state, so a conversation can be resumed from a brand new runtime session. This makes a nice, concrete demonstration of why EFS matters and complements what `02-claude-code-with-efs` already shows about shared skills.
- Codex refuses to run outside a git repository unless `skipGitRepoCheck` is set, so the workspace needs initializing on first boot.

### Proposal

Add `03-codex-with-efs` as a sibling to `02-claude-code-with-efs`, mirroring its file layout and scripts (`setup.sh`, `deploy.py`, `update.py`, `invoke.py`, `exec_cmd.py`, `cleanup.py`, `cfn-vpc.yaml`, `Dockerfile`, `server.js`) so the two can be read side by side and the Codex-specific differences stand out.

I have this implemented and tested and will open a PR referencing this issue.

Contributor guide

Open the contributing guide

Research direction

Compare 06-workshops/01-AgentCore-runtime/12-coding-agents/02-claude-code-with-efs with the proposed 03-codex-with-efs sibling, then read the named setup.sh, deploy.py, update.py, invoke.py, exec_cmd.py, cleanup.py, cfn-vpc.yaml, Dockerfile, and server.js files. Follow the sample's deployment and invocation flow; done means the Codex EFS sample is present, tested, and demonstrates persistent threads alongside the existing Claude Code sample.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, git, python
Domain
ai, cloud, infrastructure
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.