Skip to main content

Module planning

Module planning 

Source
Expand description

Canonical plan-mode enter/exit phrase sets and matchers.

Plan-mode intent detection lives in two consumers — the runloop (detect_planning_intent) and the Codex app-server bridge (normalize_planning_input). Both must agree on which phrases enter, exit, or stay in plan mode, so the phrase literals live here as the single source of truth. Each consumer keeps its own matching strategy (the runloop matches natural-language substrings; the Codex bridge matches bare tokens exactly) but draws the literals from this module so they cannot drift apart.

Constants§

APPROVAL_PHRASES
Multi-word approval phrases.
APPROVAL_WORDS
Whole-word approval tokens (so “disapprove” does not match “approve”).
ENTER_PHRASES
Phrases that enter plan mode (does not include the /plan slash command, which callers check separately).
EXECUTION_MODE_ALIASES
Aliases that clear the planning-active flag AND switch to execution mode. Used by the Codex bridge’s bare-token exact matching. Includes the implementation intents that the runloop recognizes so the two paths cannot drift (previously the bridge silently missed approve/lgtm/ship it).
EXIT_DIRECT_COMMANDS
Short imperative commands that exit plan mode and start implementing. Matched exactly (whole-trimmed) by the runloop, and recognized by the Codex bridge as implementation aliases.
EXIT_TRIGGER_PHRASES
Longer exit trigger phrases (matched as substrings).
FLAG_CLEARING_ONLY_ALIASES
Aliases that clear the planning-active flag but are NOT implementation intents — they pass through verbatim rather than being rewritten to the execution prompt.
IMPLEMENTATION_CUES
Assistant cues that indicate a recent implementation prompt.
STAY_PHRASES
Phrases that explicitly keep the user in plan mode (highest priority). edit and revise are the short-form replies to the yes/no/edit HITL prompt surfaced when request_user_input is unavailable — they route the user back into planning revision without requiring the longer “keep planning” phrase (checkpoint turn_725).

Functions§

contains_implementation_cue
Whether the normalized assistant text contains an implementation prompt cue.
is_execution_mode_alias
Codex-bridge matcher: bare-token exact match against the execution/flag alias sets (preserves the bridge’s verbatim-input contract).
is_implementation_alias
Whether a Codex-bridge alias is an implementation intent (rewrite to the execution prompt) vs. a flag-clearing-only alias (pass through verbatim).
matches_enter_intent
Whether the normalized text is an explicit request to enter plan mode (excluding the /plan slash command, which callers check separately).
matches_exit_intent
Whether the normalized text expresses an exit-and-implement intent.
matches_stay_intent
Whether the normalized text keeps the user in plan mode (highest priority).
normalize_plan_intent
Normalize user text for plan-mode intent matching: lowercase and replace non-alphanumeric characters with spaces for flexible substring matching.