Skip to content

feat(codex): deliver architectural decisions into Codex SessionStart - #788

Merged
RaghavChamadiya merged 2 commits into
repowise-dev:mainfrom
DresdenGman:feat/codex-decisions
Jul 14, 2026
Merged

RaghavChamadiya merged 2 commits into
repowise-dev:mainfrom
DresdenGman:feat/codex-decisions

Conversation

@DresdenGman

Copy link
Copy Markdown
Contributor

Wire the existing standing-decisions injection into the Codex SessionStart hook so decisions follow the user across agents — matching the behavior that Claude Code already has.

  • Extract the MCP-usage paragraph into a module-level _MCP_CONTEXT constant
  • On SessionStart, append the relevance-ranked decisions from _session_decision_block() to the context block
  • Pass session_id from the hook payload so decision scoring uses it

Closes #786.

Wire the existing standing-decisions injection into the Codex SessionStart
hook so decisions follow the user across agents — matching the behavior that
Claude Code already has.

- Extract the MCP-usage paragraph into a module-level _MCP_CONTEXT constant
- On SessionStart, append the relevance-ranked decisions from
  _session_decision_block() to the context block
- Pass session_id from the hook payload so decision scoring uses it

Closes repowise-dev#786
@repowise-bot

repowise-bot Bot commented Jul 11, 2026 •

Copy link
Copy Markdown
Contributor

✅ Health: 7.6 (unchanged)

📋 At a glance
1 file changed health · 1 hotspot touched · 3 new findings introduced · 1 co-change pair left out. Scoped to packages.

File Score Δ Why
.../augment_cmd/codex.py 10.0 → 7.2 ▼ -2.8 🔻 introduced nested complexity, complex method, error handling

💡 .../augment_cmd/codex.py: Flatten the control flow. Pull early-return guards to the top, extract the deepest branch into a helper, and consider replacing nested conditionals with a strategy table or dispatch dict.

🔎 More signals (2)

🔥 Hotspot touched (1)

  • .../augment_cmd/command.py — 4 commits/90d, 1 dependents · primary owner: Raghav Chamadiya (100%)

🔗 Hidden coupling (1 file)

  • .../augment_cmd/command.py co-changes with .../augment_cmd/read_state.py (2× — 🟢 routine) — not in this PR.

📊 Full report · ⭐ Star Repowise · 📥 Install bot · Last updated 2026-07-13 21:12 UTC
Silence on a single PR with [skip repowise] in the title · Per-repo toggle on repowise.dev/settings?tab=bot

@RaghavChamadiya

Copy link
Copy Markdown
Member

Thanks for picking this up @DresdenGman
The SessionStart wiring looks good and matches how Claude does it in _handle_claude_session_start. Same builder, same floor and cap, session_id threaded through, and injection recording comes along for free since _session_decision_block handles that internally. No notes on that part.

One thing though: this closes #786, but the issue asks for two delivery moments and this only does one. The edit-time "governed by" notice is still missing. _handle_post_edit_use is untouched and only emits the staleness reminder, so editing a governed file in Codex won't surface the decision the way it does in Claude. The builder for it already exists (_edit_decision_notice), so it should be a small addition. Note that the post-edit handler doesn't get session_id today, so that branch needs it plumbed through too.

Can you either add the edit-time notice here, or drop "Closes #786" to "Part of #786" and open a follow-up? Just don't want the issue auto-closing with half the work still open. The SessionStart change itself is ready.

Wire the existing _edit_decision_notice builder into the Codex post-edit
hook so editing a governed file surfaces the same once-per-decision
notice Claude Code delivers — matching the second half of what repowise-dev#786
asked for.

- _handle_post_edit_use accepts session_id and tool_input params
- On edit, reloads session state and calls _edit_decision_notice
  with the edited file's repo-relative path
- Staleness reminder + decision notice combined into one response

Closes repowise-dev#786
@DresdenGman

Copy link
Copy Markdown
Contributor Author

Added the edit-time governing-decision notice — _handle_post_edit_use now accepts session_id + tool_input and calls _edit_decision_notice with the edited file's repo-relative path, same builder Claude uses. Staleness reminder + decision notice combined into one response.

@RaghavChamadiya RaghavChamadiya left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

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.

[Feature] Deliver architectural decisions into Codex sessions (SessionStart block + edit-time notice)

2 participants