{"id":49888899,"url":"https://github.com/langchain-ai/langsmith-codex-plugins","last_synced_at":"2026-05-15T20:01:25.822Z","repository":{"id":357295564,"uuid":"1220525190","full_name":"langchain-ai/langsmith-codex-plugins","owner":"langchain-ai","description":"LangSmith plugin for OpenAI Codex","archived":false,"fork":false,"pushed_at":"2026-05-06T01:10:53.000Z","size":521,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-12T07:43:16.755Z","etag":null,"topics":["codex","codex-plugin","langsmith"],"latest_commit_sha":null,"homepage":"https://langchain.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/langchain-ai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-25T02:03:55.000Z","updated_at":"2026-05-10T20:23:57.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/langchain-ai/langsmith-codex-plugins","commit_stats":null,"previous_names":["langchain-ai/langsmith-codex-plugins"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/langchain-ai/langsmith-codex-plugins","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/langchain-ai%2Flangsmith-codex-plugins","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/langchain-ai%2Flangsmith-codex-plugins/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/langchain-ai%2Flangsmith-codex-plugins/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/langchain-ai%2Flangsmith-codex-plugins/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/langchain-ai","download_url":"https://codeload.github.com/langchain-ai/langsmith-codex-plugins/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/langchain-ai%2Flangsmith-codex-plugins/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33077916,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T11:35:32.926Z","status":"ssl_error","status_checked_at":"2026-05-15T11:35:31.362Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["codex","codex-plugin","langsmith"],"created_at":"2026-05-15T20:00:56.626Z","updated_at":"2026-05-15T20:01:25.812Z","avatar_url":"https://github.com/langchain-ai.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LangSmith Tracing Plugin for OpenAI Codex\n\nA Codex plugin that traces agent turns, tool calls, model metadata, and subagent threads to [LangSmith](https://smith.langchain.com).\n\n## Prerequisites\n\n- Node.js \u003e= 22.x\n- Codex \u003e= 0.128\n- A LangSmith account and API key\n\n## Installation\n\n### As a Codex plugin\n\nAdd the marketplace via Codex CLI:\n\n```bash\ncodex plugin marketplace add langchain-ai/langsmith-codex-plugins\n```\n\nThen enable plugin hooks and the Tracing plugin globally in `~/.codex/config.toml` or only for a specific project in `.codex/config.toml`:\n\n```toml\n[features]\nplugin_hooks = true\n\n[plugins.\"tracing@langsmith-codex-plugins\"]\nenabled = true\n```\n\n### Setting environment variables\n\n**Option 1: Shell environment (recommended)**\n\nAdd to your `~/.zshrc`, `~/.bashrc`, or `~/.bash_profile`:\n\n```bash\nexport LANGSMITH_CODEX_API_KEY=\"lsv2_pt_...\"\nexport LANGSMITH_CODEX_PROJECT=\"codex\"\nexport TRACE_TO_LANGSMITH=\"true\"\n```\n\n**Option 2: JSON config file**\n\nCreate `~/.codex/langsmith.json` (global) or `\u003cproject\u003e/.codex/langsmith.json` (per-project):\n\n```json\n{\n  \"enabled\": true,\n  \"api_key\": \"lsv2_pt_...\",\n  \"project\": \"codex\"\n}\n```\n\nConfig files are loaded from `~/.codex/langsmith.json` first, then `\u003cproject\u003e/.codex/langsmith.json`. Environment variables take precedence over both. `LANGSMITH_CODEX_*` variables take precedence over the matching standard `LANGSMITH_*` variables.\n\n### Getting your LangSmith API key\n\n1. Go to [smith.langchain.com](https://smith.langchain.com)\n2. Sign in or create an account\n3. Navigate to **Settings** → **API Keys**\n4. Click **Create API Key**\n5. Copy the key (starts with `lsv2_pt_...`)\n\nComplete a Codex turn, then look for runs in the `codex` project in LangSmith.\n\n## What gets traced\n\nEach LLM run includes:\n\n- **Inputs**: accumulated conversation messages\n- **Outputs**: assistant response content\n- **Metadata**: model provider, model name, stop reason, token usage\n\nSubagent threads are resolved and uploaded as nested child runs under the parent turn. Tool calls (function calls, shell calls, computer calls, file reads, web searches) are included with inputs and outputs.\n\nInterrupted turns (where the user cancels mid-response) are still uploaded upon session completion.\n\n## Environment variables\n\nTracing is disabled unless `TRACE_TO_LANGSMITH` or `enabled` is set to `true`.\n\n| Variable                                                     | Required | Default                           | Description                                                                  |\n| ------------------------------------------------------------ | -------- | --------------------------------- | ---------------------------------------------------------------------------- |\n| `TRACE_TO_LANGSMITH`                                         | Yes      | —                                 | Set to `\"true\"` to enable tracing                                            |\n| `LANGSMITH_CODEX_API_KEY`, `LANGSMITH_API_KEY`               | Yes\\*    | —                                 | LangSmith API key. \\*Required unless `LANGSMITH_CODEX_RUNS_ENDPOINTS` is set |\n| `LANGSMITH_CODEX_PROJECT`, `LANGSMITH_PROJECT`               | No       | `\"codex\"`                         | LangSmith project name                                                       |\n| `LANGSMITH_CODEX_ENDPOINT`, `LANGSMITH_ENDPOINT`             | No       | `https://api.smith.langchain.com` | LangSmith API base URL                                                       |\n| `LANGSMITH_CODEX_METADATA`, `LANGSMITH_METADATA`             | No       | —                                 | JSON object of custom metadata to attach to all runs                         |\n| `LANGSMITH_CODEX_RUNS_ENDPOINTS`, `LANGSMITH_RUNS_ENDPOINTS` | No       | —                                 | JSON array of replica destinations for multi-project tracing                 |\n\n## JSON config reference\n\n| Config key | Environment variable                                         | Default           | Description            |\n| ---------- | ------------------------------------------------------------ | ----------------- | ---------------------- |\n| `enabled`  | `TRACE_TO_LANGSMITH`                                         | `false`           | Enable tracing         |\n| `api_key`  | `LANGSMITH_CODEX_API_KEY`, `LANGSMITH_API_KEY`               | unset             | LangSmith API key      |\n| `api_url`  | `LANGSMITH_CODEX_ENDPOINT`, `LANGSMITH_ENDPOINT`             | LangSmith default | API endpoint           |\n| `project`  | `LANGSMITH_CODEX_PROJECT`, `LANGSMITH_PROJECT`               | `\"codex\"`         | Project name           |\n| `metadata` | `LANGSMITH_CODEX_METADATA`, `LANGSMITH_METADATA`             | unset             | Custom metadata object |\n| `replicas` | `LANGSMITH_CODEX_RUNS_ENDPOINTS`, `LANGSMITH_RUNS_ENDPOINTS` | unset             | Replica destinations   |\n\n## Tracing to multiple destinations (Replicas)\n\nYou can trace to multiple LangSmith projects or workspaces simultaneously using `LANGSMITH_CODEX_RUNS_ENDPOINTS`. This is useful for:\n\n- Sending traces to both a production and staging project\n- Tracing to multiple workspaces with different API keys\n- Attaching extra metadata to specific replica destinations\n\nSet `LANGSMITH_CODEX_RUNS_ENDPOINTS` to a JSON array of replica configurations. When set, this overrides other client settings.\n\n**Option 1: JSON config file (recommended)**\n\nIn `~/.codex/langsmith.json` or `\u003cproject\u003e/.codex/langsmith.json`:\n\n```json\n{\n  \"enabled\": true,\n  \"replicas\": [\n    {\n      \"apiUrl\": \"https://api.smith.langchain.com\",\n      \"apiKey\": \"lsv2_pt_workspace_a\",\n      \"projectName\": \"project-prod\"\n    },\n    {\n      \"apiUrl\": \"https://api.smith.langchain.com\",\n      \"apiKey\": \"lsv2_pt_workspace_b\",\n      \"projectName\": \"project-staging\",\n      \"updates\": { \"metadata\": { \"environment\": \"staging\" } }\n    }\n  ]\n}\n```\n\n**Option 2: Shell environment variable**\n\n```bash\nexport LANGSMITH_CODEX_RUNS_ENDPOINTS='[{\"apiUrl\":\"https://api.smith.langchain.com\",\"apiKey\":\"lsv2_pt_workspace_a\",\"projectName\":\"project-prod\"},{\"apiUrl\":\"https://api.smith.langchain.com\",\"apiKey\":\"lsv2_pt_workspace_b\",\"projectName\":\"project-staging\",\"updates\":{\"metadata\":{\"environment\":\"staging\"}}}]'\n```\n\n\u003e **Tip:** To generate the escaped JSON string, use: `echo '[{\"apiUrl\":\"...\",\"apiKey\":\"...\",\"projectName\":\"...\"}]' | jq -c .`\n\n### Replica format\n\n| Field         | Required | Description                                                     |\n| ------------- | -------- | --------------------------------------------------------------- |\n| `apiUrl`      | Yes      | LangSmith API URL (typically `https://api.smith.langchain.com`) |\n| `apiKey`      | Yes      | API key for the destination workspace                           |\n| `projectName` | Yes      | Project name in the destination workspace                       |\n| `updates`     | No       | Optional metadata/fields to override on the replicated runs     |\n\n## Troubleshooting\n\n- **No runs appear**: confirm `plugin_hooks = true`, the plugin is enabled, and `TRACE_TO_LANGSMITH=true` is visible to the Codex process.\n- **Authentication fails**: check that `LANGSMITH_CODEX_API_KEY` or `LANGSMITH_API_KEY` is set and valid.\n- **Runs appear in the wrong project**: set `LANGSMITH_CODEX_PROJECT` or the `project` config key.\n- **Custom endpoint not used**: set `LANGSMITH_CODEX_ENDPOINT` or the `api_url` config key.\n\n## Data sent to LangSmith\n\nWhen enabled, the plugin uploads completed Codex transcript data to LangSmith, including messages, tool call inputs and outputs, model metadata, token usage, and subagent thread structure. Do not enable tracing for sessions that contain data you do not want stored in LangSmith.\n\n## Development\n\n```bash\npnpm install\npnpm test        # Run tests\npnpm lint        # Run linter\npnpm build       # Production build\n```\n\nAfter making changes, run `pnpm build` and complete a new Codex turn to pick up the updated hooks.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flangchain-ai%2Flangsmith-codex-plugins","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flangchain-ai%2Flangsmith-codex-plugins","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flangchain-ai%2Flangsmith-codex-plugins/lists"}