Skip to content

feat(opencode): add codex estimated cost flag - #35131

Closed
major wants to merge 1 commit into
anomalyco:devfrom
major:codex-cost-estimate
Closed

feat(opencode): add codex estimated cost flag#35131
major wants to merge 1 commit into
anomalyco:devfrom
major:codex-cost-estimate

Conversation

@major

@majormajor commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes#35133

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Keeps ChatGPT/Codex subscription auth showing actual marginal cost as $0.00 by default.

Adds OPENCODE_CODEX_SHOW_ESTIMATED_COST=true so users can opt in to API-equivalent estimated costs for Codex models.

Documents the flag and covers default/opt-in model pricing behavior.

How did you verify your code works?

  • bunx prettier --check packages/opencode/src/effect/runtime-flags.ts packages/opencode/src/plugin/index.ts packages/opencode/src/plugin/openai/README.md packages/opencode/src/plugin/openai/codex.ts packages/opencode/test/plugin/codex.test.ts
  • cd packages/opencode && bun test test/plugin/codex.test.ts
  • cd packages/opencode && bun typecheck
  • pre-push hook: bun turbo typecheck

Screenshots / recordings

Not a UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actionsgithub-actionsBot added needs:compliance This means the issue will auto-close after 2 hours. contributor labels Jul 3, 2026
@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

The only potentially related PR found is #30164 "feat(tui): show estimated live token throughput in footer", but this appears to be about displaying token throughput in the UI rather than adding a cost estimation flag for Codex. They are separate features.

No duplicate PRs found

@github-actionsgithub-actionsBot removed the needs:compliance This means the issue will auto-close after 2 hours. label Jul 3, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@major
majorforce-pushed the codex-cost-estimate branch from d837299 to 982a0deCompareJuly 3, 2026 11:47
@major
majorforce-pushed the codex-cost-estimate branch from 982a0de to 60add77CompareJuly 10, 2026 13:22
- keep Codex subscription cost zeroed by default
- add opt-in API-equivalent estimates via environment flag
- document and test both pricing modes
Signed-off-by: Major Hayden <major@mhtx.net>
@github-actions

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: show optional estimated Codex token costs

1 participant

@major