Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ body:
id: version
attributes:
label: Version
placeholder: 0.4.1
placeholder: 1.0.0
validations:
required: true
- type: dropdown
Expand Down
28 changes: 28 additions & 0 deletions .github/release-notes/v1.0.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Codex Trajectory v1.0.0

Version 1.0.0 establishes the current native Codex desktop viewer as the first stable release. It brings local task history, timing, Token usage, estimated API costs, and live activity into the conversation side panel.

- Open **+ → More tools… → Plugins and MCPs → Codex Trajectory** to inspect the calling task without a model turn, with a local task selector when task context is unavailable.
- Support standard MCP Apps initialization, host context, theme, locale, display modes, and teardown alongside the legacy host bridge.
- Start with safe summaries, load bounded record details on demand after confirmation, and optionally remember full-detail consent on this device. Live views always use safe summaries.
- Browse plain, compressed, and paginated task history with search, filters, earlier-record loading, and an explicit task-local read-budget increase for oversized logs.
- Improve timing accuracy, cumulative Token totals, late tool-result handling, quota sampling, bounded caches, and large-timeline rendering. Refresh the bundled API price snapshot for GPT-6.1 Sol and GPT-6 Astra, Sol, and Luna.
- Keep MCP control traffic responsive, sanitize provider errors, and retain the portable windowless Windows launcher with reproducible builds and archive validation.
- Bound full-detail JSON formatting before allocation can expand nested records into large indented strings; stop within the detail budget and show a truncation notice without counting omitted characters.
- Remove the injected CDP viewer, debugging-port setup, watcher recovery, manual stop, and quota-triggered automatic stop. Published trajectory schemas v1 and v2 remain unchanged.

After upgrading, fully quit and reopen Codex, then open the native panel entry. Older clients without the native extension can use `show_codex_trajectory` with an explicit `sessionId`. See the [native viewer guide](../../docs/native-viewer.md) for migration and troubleshooting and the [changelog](../../CHANGELOG.md#100---2026-10-02) for the complete changes.

## 简体中文

1.0.0 将当前 Codex 桌面端原生查看器作为首个稳定版本,在任务侧栏中展示本地任务过程、耗时、Token 用量、API 费用估算和实时活动。

- 从 **+ → More tools… → Plugins and MCPs → Codex Trajectory** 直接打开当前任务,无需触发模型对话;无法识别任务时提供本地任务选择器。
- 支持标准 MCP Apps 协议及旧宿主桥接,包括主题、语言、显示模式和面板生命周期。
- 默认显示安全摘要,确认后按需加载有长度限制的记录详情,可为本机记住全文详情授权;实时视图始终使用安全摘要。
- 支持普通、压缩和分页历史的搜索、筛选与更早记录加载,并可为超大日志显式提高当前任务的读取上限。
- 修正耗时、累计 Token、延迟工具结果和大时间轴显示,更新内置 API 价格,并完善缓存、协议和打包校验。
- 在详情格式化过程中限制输出预算,避免深层或大数组 JSON 先展开成巨量缩进文本;达到上限后停止处理,并显示不统计省略字符数的截断提示。
- 移除 CDP 注入查看器、调试端口配置、后台监视器、手动停止和额度触发的自动停止功能;已公开的 v1/v2 数据结构保持不变。

更新后请完整退出并重新打开 Codex,再打开原生侧栏入口。旧客户端可通过明确指定 `sessionId` 的 `show_codex_trajectory` 使用查看器。迁移和故障排查见[原生查看器指南](../../docs/native-viewer.md),完整变更见[更新日志](../../CHANGELOG.md#100---2026-10-02)。
18 changes: 8 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,11 @@ jobs:
- name: Enforce focused coverage floors
run: |
uv run coverage report --include='plugins/codex-trajectory/scripts/codex_trajectory/*.py' --fail-under=85
uv run coverage report --include='plugins/codex-trajectory/scripts/codex_trajectory/browser_view.py' --fail-under=90
uv run coverage report --include='plugins/codex-trajectory/scripts/codex_trajectory/cdp_peer.py' --fail-under=45
uv run coverage report --include='plugins/codex-trajectory/scripts/codex_trajectory/cdp_settings.py' --fail-under=80
uv run coverage report --include='plugins/codex-trajectory/scripts/codex_trajectory_cdp.py' --fail-under=50
uv run coverage report --include='plugins/codex-trajectory/scripts/codex_trajectory/native_view.py,plugins/codex-trajectory/scripts/codex_trajectory/tools.py' --fail-under=90
uv run coverage report --include='plugins/codex-trajectory/scripts/codex_trajectory_mcp.py' --fail-under=85
- run: uv run python scripts/validate_release.py
- name: Verify reproducible Windows launcher source/binary parity
run: uv run --no-project --script scripts/build_windows_launcher.py --check
- run: uv run python scripts/smoke_mcp.py

runtime:
Expand Down Expand Up @@ -80,14 +79,14 @@ jobs:
-W error::ResourceWarning
-W error::pytest.PytestUnraisableExceptionWarning
- run: uv run python scripts/smoke_mcp.py
- name: Install Chromium for the focused Windows CDP test
- name: Install Chromium for the Windows native panel tests
if: runner.os == 'Windows' && matrix.python == '3.12'
run: uv run playwright install chromium
- name: Exercise the Windows CDP browser transport
- name: Exercise the Windows native panel
if: runner.os == 'Windows' && matrix.python == '3.12'
run: >-
uv run pytest
plugins/codex-trajectory/tests/test_cdp_transport.py
plugins/codex-trajectory/tests/test_ui.py
-m ui
-q
env:
Expand All @@ -110,7 +109,6 @@ jobs:
- run: >-
uv run pytest
plugins/codex-trajectory/tests/test_ui.py
plugins/codex-trajectory/tests/test_cdp_transport.py
-q
env:
RUN_UI_TESTS: "1"
Expand Down Expand Up @@ -141,5 +139,5 @@ jobs:
tar_root="$(mktemp -d)"
unzip -q "$zip_path" -d "$zip_root"
tar -xzf "$tar_path" -C "$tar_root"
uv run --no-project python "$zip_root/codex-trajectory-$version/scripts/smoke_mcp.py"
uv run --no-project python "$tar_root/codex-trajectory-$version/scripts/smoke_mcp.py"
uv run --no-project --script "$zip_root/codex-trajectory-$version/scripts/smoke_mcp.py"
uv run --no-project --script "$tar_root/codex-trajectory-$version/scripts/smoke_mcp.py"
11 changes: 4 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,9 @@ jobs:
uv run mypy --no-incremental --platform win32
uv run pytest --cov --cov-report=term-missing
uv run coverage report --include='plugins/codex-trajectory/scripts/codex_trajectory/*.py' --fail-under=85
uv run coverage report --include='plugins/codex-trajectory/scripts/codex_trajectory/browser_view.py' --fail-under=90
uv run coverage report --include='plugins/codex-trajectory/scripts/codex_trajectory/cdp_peer.py' --fail-under=45
uv run coverage report --include='plugins/codex-trajectory/scripts/codex_trajectory/cdp_settings.py' --fail-under=80
uv run coverage report --include='plugins/codex-trajectory/scripts/codex_trajectory_cdp.py' --fail-under=50
uv run coverage report --include='plugins/codex-trajectory/scripts/codex_trajectory/native_view.py,plugins/codex-trajectory/scripts/codex_trajectory/tools.py' --fail-under=90
uv run coverage report --include='plugins/codex-trajectory/scripts/codex_trajectory_mcp.py' --fail-under=85
RUN_UI_TESTS=1 uv run pytest plugins/codex-trajectory/tests/test_ui.py plugins/codex-trajectory/tests/test_cdp_transport.py -q
RUN_UI_TESTS=1 uv run pytest plugins/codex-trajectory/tests/test_ui.py -q
uv run python scripts/smoke_mcp.py
mkdir -p dist
git archive --format=zip --prefix="codex-trajectory-$version/" --output="dist/codex-trajectory-v$version.zip" HEAD
Expand All @@ -63,8 +60,8 @@ jobs:
tar_root="$(mktemp -d)"
unzip -q "dist/codex-trajectory-v$version.zip" -d "$zip_root"
tar -xzf "dist/codex-trajectory-v$version.tar.gz" -C "$tar_root"
uv run --no-project python "$zip_root/codex-trajectory-$version/scripts/smoke_mcp.py"
uv run --no-project python "$tar_root/codex-trajectory-$version/scripts/smoke_mcp.py"
uv run --no-project --script "$zip_root/codex-trajectory-$version/scripts/smoke_mcp.py"
uv run --no-project --script "$tar_root/codex-trajectory-$version/scripts/smoke_mcp.py"
cd dist
sha256sum codex-trajectory-v* > SHA256SUMS
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
Expand Down
38 changes: 37 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,41 @@ All notable changes follow [Keep a Changelog](https://keepachangelog.com/en/1.1.

## [Unreleased]

## [1.0.0] - 2026-10-02

### Added

- Remember the viewer's full-detail opt-in across tasks, panel reopening, and restarts through a local boolean preference. Offer a checked confirmation option for future tasks, a panel-only alternative, and a button to restore safe-summary defaults; preserve public tool and live-view summary defaults.
- Let users raise an oversized task's read budget from its error page, with a size-based GB suggestion and task-local enable/retry action. Preserve that panel's choice across refresh, pagination, full details, and live updates; keep the 512 MiB default for other tasks and allow explicit budgets up to 64 GB.
- Open the calling task from Codex's native conversation side panel through an app-only MCP entrypoint. Validate per-request task metadata and show a selector when caller identity or local history is unavailable.
- Support the standard MCP Apps initialization, host-context, theme, locale, display-mode, and teardown protocol alongside the legacy host bridge.

### Removed

- Retire manual stop and quota-triggered automatic stop. Remove CDP transports, toolbar injection, watcher recovery, loopback browser wrappers, their app-only tools, and obsolete platform canaries.

### Changed

- Load viewer details on demand after a record click, sharing pending page reads and caching at most 5 MiB. Keep opening, refresh, task switches, and history pagination in summary mode even with remembered consent; skip formatting hidden inputs and outputs in summary projections. Public full-detail reads and frozen schemas remain unchanged.
- Show saved analysis text directly in multiline previews and opted-in longer summaries directly in the inspector across all projects. For unavailable summaries, directly show numbered neighboring events as context or a dash, and keep the missing-summary notice in hover and details instead of prefixing every preview. Respect turn boundaries, missing indexes, and the live view's safe tail. Keep schemas and privacy defaults unchanged.
- Refresh the standard API token-price snapshot on 2026-10-01 to cover GPT-6.1 Sol, GPT-6 Astra, GPT-6 Sol, and GPT-6 Luna, preserving their separately published cache-read prices.
- Separate the MCP tool catalog from rollout projection and share filesystem safety checks independently of the retired integration. Preserve public tool defaults, frozen schemas, live usage/cost/quota display, and the portable windowless launcher.

- Restrict the viewer, acceptance coverage, and packaged screenshots to supported Codex desktop surfaces.
- Default trajectory reads to active tasks, require an explicit task ID for full-detail access, and document the private search index's writes and title sensitivity in the plugin and bundled skill.

### Fixed

- Finish background cache initialization and close temporary SQLite page indexes before directory finalizers run at process exit, preventing shutdown races and Windows file-lock cleanup errors; keep repeated explicit cleanup safe.
- Format full-detail JSON incrementally within the 12,000-character budget, including escaped strings and object keys, instead of building complete indented output before truncation. Stop at the budget without counting omitted characters and keep non-JSON fallbacks bounded; add allocation regressions and a full-tool-read check for deeply nested, wide records.
- Prevent recursive viewer initialization and repeated preference reads when a legacy host supplies its initial tool output before startup.
- Report oversized local tasks with their byte counts instead of treating them as missing, and allow ten minutes for explicitly enabled large-log viewer requests.
- Show unconfirmed timing as `-` across every viewer surface. Leave zero, sub-millisecond, missing, and invalid durations unknown; prevent explicit unconfirmed completion timing from being replaced by other timestamps. Keep terminal-only tools, orphan results, and completion-only turns untimed, and leave aggregate duration unknown when a loaded turn has no confirmed timing.
- Correct compressed-rollout metadata search, lineage scan budgets, exact task identity precedence, concurrent index merging, cumulative Token deltas, and late tool-result timing. Bound projection caches, response pages, and browser history without breaking pagination.
- Keep MCP control traffic responsive under slow or saturated business requests, enforce initialization and notification semantics, sanitize provider failures, and recover browser loading errors with bounded requests and retry controls.
- Fix large-timeline rendering, narrow-screen layout, session-selection recovery, and live-scroll anchoring; add regression and browser coverage without replacing end-to-end assertions with dispatch-only checks.
- Rebuild the Windows launcher from its corrected C source with a pinned reproducible toolchain, freeze both published schema hashes, run extracted archive smoke tests with declared dependencies, and verify installed candidates through their declared MCP entrypoint.

## [0.4.1] - 2026-09-20

### Fixed
Expand Down Expand Up @@ -162,4 +197,5 @@ All notable changes follow [Keep a Changelog](https://keepachangelog.com/en/1.1.
[0.3.2]: https://github.com/icesixgod/codex-trajectory/compare/v0.3.1...v0.3.2
[0.4.0]: https://github.com/icesixgod/codex-trajectory/compare/v0.3.2...v0.4.0
[0.4.1]: https://github.com/icesixgod/codex-trajectory/compare/v0.4.0...v0.4.1
[Unreleased]: https://github.com/icesixgod/codex-trajectory/compare/v0.4.1...HEAD
[1.0.0]: https://github.com/icesixgod/codex-trajectory/compare/v0.4.1...v1.0.0
[Unreleased]: https://github.com/icesixgod/codex-trajectory/compare/v1.0.0...HEAD
15 changes: 4 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,19 @@ uv run mypy
uv run mypy --no-incremental --platform win32
uv run pytest --cov --cov-report=term-missing
uv run python scripts/validate_release.py
uv run python scripts/smoke_mcp.py
uv run --no-project --script scripts/smoke_mcp.py
```

`smoke_mcp.py` executes the command declared by the packaged `.mcp.json`; do not replace it with a hand-built equivalent command. The relative launcher executes `uv` directly on Unix. On Windows, the smoke verifies the reviewed binary hash, rejects a console-subsystem launcher, and exercises its inherited stdio path end to end. Rebuild `codex_trajectory_launcher.exe` only from its adjacent C source using the documented Visual Studio x64 commands; the `/Brepro` link makes repeated builds deterministic with the same toolchain. The default coverage run measures Python only, so the CI gates `browser_view.py`, `cdp_peer.py`, `cdp_settings.py`, the CDP transport, and the MCP entry point separately instead of relying only on the project-wide percentage.
`smoke_mcp.py` executes the command declared by the packaged `.mcp.json`; do not replace it with a hand-built equivalent command. The relative launcher executes `uv` directly on Unix. On Windows, the smoke verifies the reviewed binary hash, rejects a console-subsystem launcher, and exercises its inherited stdio path end to end. Rebuild `codex_trajectory_launcher.exe` only from its adjacent C source. The packaged binary uses the pinned Zig 0.14.1 cross-toolchain: run `uv run --no-project --script scripts/build_windows_launcher.py`, then repeat with `--check` to verify byte equality. CI runs the parity check. Update the reviewed SHA-256 in both release validation and the stdio smoke after reviewing a new binary. The source also documents an alternative Visual Studio x64 build; do not expect different toolchains to emit identical bytes. Native Windows stdio smoke remains required before a Windows release. Focused coverage gates protect the parser modules, native task-context layer, tool dispatcher, and MCP entry point.

Browser acceptance tests are opt-in locally:

```sh
RUN_UI_TESTS=1 uv run pytest -m ui -q
```

CI runs the full browser suite on Linux and the focused CDP browser transport on Windows. Before a Windows release that changes launcher, watcher, peer authentication, or injection behavior, install the candidate plugin, start Codex with loopback CDP enabled, open this repository as a Codex task, and run the installed-app canary from that task:
CI runs the browser suite on Linux and the native panel tests on Windows. Local tests emulate both the standard MCP Apps handshake and the legacy host bridge; they exercise actual rendering, pagination, live refresh, theme/locale changes, task selection, and teardown. For an installed candidate, run the same packaged stdio smoke with `--plugin-root` and optionally `--local-session` to check an exact real local task. See [native migration and local testing](docs/native-viewer.md).

```powershell
$env:RUN_WINDOWS_CODEX_CANARY = '1'
uv run python scripts/smoke_windows_codex.py
```

The canary requires the optional shortcut to be enabled and verifies the outer `ChatGPT.exe` identity, live watcher state, authenticated CDP connection, and a visible session-ready shortcut in the real Codex DOM. It is intentionally not run on GitHub-hosted workers because they do not contain the packaged Codex desktop app.

Behavior changes need focused tests and corresponding English and Chinese documentation updates. Changes to session storage must cover plain and compressed rollouts on Python 3.10 and 3.14; CDP changes must cover disabled, cleanup-only, absolute-deadline, the real packaged Windows process-tree shape, and the installed-app canary when applicable. Never commit real Codex task logs, credentials, base instructions, encrypted reasoning, or unredacted screenshots.
Behavior changes need focused tests and corresponding English and Chinese documentation updates. Changes to session storage must cover plain and compressed rollouts on Python 3.10 and 3.14; native-entry changes must cover exact caller identity, absent/conflicting context, task isolation, host lifecycle, and supported-client integration. Never commit real Codex task logs, credentials, base instructions, encrypted reasoning, or unredacted screenshots.

Use conventional, imperative commit subjects. Pull requests should explain the user-visible behavior, privacy impact, and validation performed.
Loading
Loading