Skip to content

feat: add decision kind constants for host ergonomics#135

Merged
rlippmann merged 2 commits into
mainfrom
codex/decision-kind-consts
May 23, 2026
Merged

feat: add decision kind constants for host ergonomics#135
rlippmann merged 2 commits into
mainfrom
codex/decision-kind-consts

Conversation

@rlippmann
Copy link
Copy Markdown
Owner

@rlippmann rlippmann commented May 23, 2026

What changed

  • Added public decision-kind constants in a dedicated module:
    • DECISION_PASSTHROUGH = "passthrough"
    • DECISION_UPDATE = "update"
    • DECISION_CLARIFY = "clarify"
  • Exported those constants from package root (context_compiler).
  • Added a small value test to assert constant values match the Decision kind strings.
  • Updated the public API contract fixture required exports for the new constants.
  • Made minimal readability updates in README and one host-facing example to use the constants.
  • Follow-up cleanup: replaced raw decision-kind string comparisons with constants across user-facing branching code in examples/, demos/, Open WebUI/LiteLLM integration examples, and REPL rendering logic.

Why

  • Reduce repeated semantic string literals in host-facing branching.
  • Lower typo risk while preserving the existing structural Decision/State contracts and JSON portability.
  • Keep ergonomics improvement intentionally small without adding helper predicates or broader abstractions.

Checklist

  • pre-commit run (uv run pre-commit run --all-files)
  • tests pass (uv run pytest)

@rlippmann rlippmann merged commit 75fc39f into main May 23, 2026
12 checks passed
@rlippmann rlippmann deleted the codex/decision-kind-consts branch May 23, 2026 02:00
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.

1 participant