Skip to content

fix(codex): preserve context config in remote sessions - #1633

Open
NightWatcher314 wants to merge 1 commit into
tiann:mainfrom
NightWatcher314:fix/codex-context-config
Open

fix(codex): preserve context config in remote sessions#1633
NightWatcher314 wants to merge 1 commit into
tiann:mainfrom
NightWatcher314:fix/codex-context-config

Conversation

@NightWatcher314

Copy link
Copy Markdown
Contributor

Summary

  • read the effective Codex configuration from codex app-server using config/read
  • forward model_context_window and model_auto_compact_token_limit through the shared thread config
  • apply the same values to fresh, resumed, forked, /compact, and /goal thread paths
  • fail open for older Codex runtimes that do not support config/read

Closes #1631.

Why

HAPI remote sessions use codex app-server and per-thread configuration. Without explicitly preserving these two effective config values, a selected model can fall back to its catalog context window even when direct Codex sessions honor larger values from ~/.codex/config.toml.

Validation

  • bun run typecheck
  • bun run test
  • targeted Codex tests: 117 passed
  • live read-only protocol probe against Codex CLI 0.147.0 confirmed config/read returns:
    • model_context_window = 400000
    • model_auto_compact_token_limit = 300000

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Findings

  • None.

Questions

  • None.

Summary
Review mode: initial

No high-confidence issues found in the added or modified lines. Static review covered the config/read handshake, value validation and fail-open behavior, and propagation through fresh, resumed, imported-fork, /compact, and /goal thread initialization paths. Residual testing gap: the new launcher test directly asserts fresh and resumed threads only; the specialized imported-fork, /compact, and /goal paths rely on the shared builder without path-specific assertions.

Testing

  • Not run (automation; PR code treated as untrusted). GitHub integration passed; test was pending at review time.

HAPI Bot

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.

feat(codex): preserve model context and auto-compaction settings in remote sessions

1 participant