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
/planslash 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).
editandreviseare the short-form replies to the yes/no/edit HITL prompt surfaced whenrequest_user_inputis 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
/planslash 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.