@wwwyo/codex-observability-plugin 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.codex-plugin/plugin.json +29 -0
- package/LICENSE +21 -0
- package/README.md +115 -0
- package/dist/index.mjs +35765 -0
- package/hooks/hooks.json +16 -0
- package/package.json +48 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "tracing",
|
|
3
|
+
"version": "0.4.1",
|
|
4
|
+
"description": "Personal Langfuse fork with optional compact Codex turn tracing.",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Langfuse",
|
|
7
|
+
"email": "support@langfuse.com",
|
|
8
|
+
"url": "https://langfuse.com"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://github.com/wwwyo/codex-observability-plugin#readme",
|
|
11
|
+
"repository": "https://github.com/wwwyo/codex-observability-plugin",
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"keywords": ["codex", "hooks", "langfuse", "observability", "tracing"],
|
|
14
|
+
"hooks": "./hooks/hooks.json",
|
|
15
|
+
"interface": {
|
|
16
|
+
"displayName": "Tracing (wwwyo fork)",
|
|
17
|
+
"shortDescription": "Trace Codex sessions to Langfuse with optional compact turns",
|
|
18
|
+
"longDescription": "Uploads completed OpenAI Codex rollout transcripts to Langfuse so teams can inspect Codex sessions as traces: agent turns, model calls, tool executions, token usage, and subagent threads.",
|
|
19
|
+
"developerName": "wwwyo (Langfuse fork)",
|
|
20
|
+
"category": "Coding",
|
|
21
|
+
"capabilities": ["Read"],
|
|
22
|
+
"websiteURL": "https://github.com/wwwyo/codex-observability-plugin",
|
|
23
|
+
"privacyPolicyURL": "https://langfuse.com/privacy",
|
|
24
|
+
"termsOfServiceURL": "https://langfuse.com/terms",
|
|
25
|
+
"defaultPrompt": [],
|
|
26
|
+
"brandColor": "#0A60B5",
|
|
27
|
+
"screenshots": []
|
|
28
|
+
}
|
|
29
|
+
}
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Langfuse GmbH
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# Langfuse Codex Plugin
|
|
2
|
+
|
|
3
|
+
This repository is [wwwyo's fork](https://github.com/wwwyo/codex-observability-plugin)
|
|
4
|
+
of [langfuse/codex-observability-plugin](https://github.com/langfuse/codex-observability-plugin).
|
|
5
|
+
It contains custom compact turn tracing and tool-error handling changes for personal
|
|
6
|
+
use; these changes are not part of the upstream release. This fork is distributed
|
|
7
|
+
as `@wwwyo/codex-observability-plugin`, with the built hook included in the npm
|
|
8
|
+
package. Generated bundles are not committed to Git.
|
|
9
|
+
|
|
10
|
+
Codex plugin that sends OpenAI Codex session telemetry to Langfuse. It traces agent turns, model generations, reasoning summaries, system prompts, tool calls, images, subagent threads, skills, and token usage.
|
|
11
|
+
|
|
12
|
+
Langfuse also documents this integration on the [Codex integration page](https://langfuse.com/integrations/developer-tools/codex).
|
|
13
|
+
|
|
14
|
+
## Quick Start
|
|
15
|
+
|
|
16
|
+
Add the plugin marketplace:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
codex plugin marketplace add wwwyo/codex-observability-plugin --ref main
|
|
20
|
+
codex plugin add tracing@codex-observability-plugin
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
The marketplace pins this fork's npm package version. After a new release, refresh
|
|
24
|
+
the registered marketplace and install the updated plugin:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
codex plugin marketplace upgrade codex-observability-plugin
|
|
28
|
+
codex plugin add tracing@codex-observability-plugin
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Then enable hooks and the plugin in `~/.codex/config.toml`, or only for one project in `<project>/.codex/config.toml`:
|
|
32
|
+
|
|
33
|
+
```toml
|
|
34
|
+
[features]
|
|
35
|
+
hooks = true
|
|
36
|
+
|
|
37
|
+
[plugins."tracing@codex-observability-plugin"]
|
|
38
|
+
enabled = true
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Restart Codex after changing the config. When **Hooks need review** appears, review the Langfuse `Stop` hook in `/hooks` and trust it. An installed and enabled plugin is not yet a trusted hook, and no traces are uploaded before you trust it. Codex records trust against the current hook hash, so a plugin update can require another review.
|
|
42
|
+
|
|
43
|
+
## Supported Versions
|
|
44
|
+
|
|
45
|
+
- Codex `0.143` and newer
|
|
46
|
+
- Node.js `22` and newer
|
|
47
|
+
- The `npm` CLI on your `PATH`, which Codex uses to fetch the plugin from the npm registry
|
|
48
|
+
- Langfuse Cloud, or self-hosted Langfuse `3.95.0` and newer
|
|
49
|
+
|
|
50
|
+
## Langfuse Credentials
|
|
51
|
+
|
|
52
|
+
Create `~/.codex/langfuse.json` (global) or `<project>/.codex/langfuse.json` (per-project) with your Langfuse credentials.
|
|
53
|
+
|
|
54
|
+
```json
|
|
55
|
+
{
|
|
56
|
+
"enabled": true,
|
|
57
|
+
"public_key": "pk-lf-...",
|
|
58
|
+
"secret_key": "sk-lf-...",
|
|
59
|
+
"base_url": "https://cloud.langfuse.com"
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Only `enabled`, `public_key` and `secret_key` are required. If `base_url` is not set, the plugin uses `https://cloud.langfuse.com` for the πͺπΊ EU region. The other regions are `https://us.cloud.langfuse.com` (πΊπΈ US), `https://jp.cloud.langfuse.com` (π―π΅ Japan) and `https://hipaa.cloud.langfuse.com` (βοΈ HIPAA).
|
|
64
|
+
|
|
65
|
+
You can also set credentials with environment variables:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
export TRACE_TO_LANGFUSE="true"
|
|
69
|
+
export LANGFUSE_PUBLIC_KEY="pk-lf-..."
|
|
70
|
+
export LANGFUSE_SECRET_KEY="sk-lf-..."
|
|
71
|
+
export LANGFUSE_BASE_URL="https://cloud.langfuse.com"
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Tracing stays off until `enabled` or `TRACE_TO_LANGFUSE` is true, so you opt in explicitly. Config is resolved as defaults, then `~/.codex/langfuse.json`, then `<project>/.codex/langfuse.json`, then environment variables, and the environment wins. `LANGFUSE_CODEX_*` variables take precedence over the matching `LANGFUSE_*` ones, so you can scope credentials to Codex without disturbing other Langfuse tooling on the same machine.
|
|
75
|
+
|
|
76
|
+
The remaining options are settable both ways, as a `langfuse.json` key or as the matching `LANGFUSE_CODEX_*` variable:
|
|
77
|
+
|
|
78
|
+
- `environment` labels the traces with an environment, for example `production`.
|
|
79
|
+
- `user_id` attaches a user to every trace. It defaults to the Codex auth email, if one is found.
|
|
80
|
+
- `tags` adds your own tags to every trace, either as a JSON array or as a comma-separated list.
|
|
81
|
+
- `metadata` attaches a JSON object to every trace.
|
|
82
|
+
- `skill_tags` tags traces with `skill:<name>` for every skill invoked in the turn, and defaults to `true`.
|
|
83
|
+
- `trace_seed` derives deterministic trace ids, so a headless caller knows a run's trace id up front. Use a unique seed per session.
|
|
84
|
+
- `detail` selects `full` (default) or `turn`, with `LANGFUSE_CODEX_DETAIL` as the environment override.
|
|
85
|
+
- `debug` logs verbosely to stderr, and defaults to `false`.
|
|
86
|
+
- `fail_on_error` fails the hook on upload errors instead of failing open, and defaults to `false`.
|
|
87
|
+
|
|
88
|
+
Everything the plugin traces is uploaded to Langfuse, including prompts and tool inputs and outputs, so do not enable it for sessions containing data you do not want stored there.
|
|
89
|
+
|
|
90
|
+
### Turn detail
|
|
91
|
+
|
|
92
|
+
Set `"detail": "turn"` in `~/.codex/langfuse.json` (without `enabled`) to
|
|
93
|
+
use one observation per turn while preserving per-project opt-in. Override with
|
|
94
|
+
`"detail": "full"` per project, or `LANGFUSE_CODEX_DETAIL=full`, for individual
|
|
95
|
+
model and tool observations.
|
|
96
|
+
|
|
97
|
+
Turn mode preserves the user input and final response, turn timing, context,
|
|
98
|
+
subagent turns, and a versioned `telemetry_summary` JSON value in turn metadata.
|
|
99
|
+
The summary contains generation/tool counts, tool names, bounded tool error
|
|
100
|
+
messages and times, and token usage grouped by model. It excludes full tool
|
|
101
|
+
input/output bodies and intermediate model responses. Failure diagnostics can
|
|
102
|
+
include up to 300 characters of tool output; turn mode reduces volume rather than
|
|
103
|
+
redacting sensitive content. If no model step has valid usage, the summary falls
|
|
104
|
+
back to the turn's delta of cumulative session counters. Aggregate-only usage
|
|
105
|
+
from a mixed-model turn is recorded under `unknown` rather than attributed to a
|
|
106
|
+
single model. Standard token/cost dashboards, tool-error filtering, and individual
|
|
107
|
+
generation latency views require full mode. Previously uploaded turns are not replayed.
|
|
108
|
+
|
|
109
|
+
## Contributing
|
|
110
|
+
|
|
111
|
+
See the [contributing guide](./CONTRIBUTING.md).
|
|
112
|
+
|
|
113
|
+
## License
|
|
114
|
+
|
|
115
|
+
[MIT](./LICENSE)
|