Skip to content

Add native Codex hook support and harden install/test flows#47

Merged
SihaoLiu merged 2 commits intoPolyArch:devfrom
shinezyy:codex-hook
Mar 28, 2026
Merged

Add native Codex hook support and harden install/test flows#47
SihaoLiu merged 2 commits intoPolyArch:devfrom
shinezyy:codex-hook

Conversation

@shinezyy
Copy link
Copy Markdown
Contributor

Add native Codex hook support and harden install/test flows

  • add native Codex hook config and installer, wire RLCR/PR stop hooks, and document Codex setup and usage
  • fix BitLesson selector routing and update related skills/docs
  • simplify install-skill target handling and harden RLCR test mock argument parsing

@shinezyy shinezyy changed the base branch from main to dev March 15, 2026 12:07
@shinezyy shinezyy changed the title Add native Codex hook support and harden install/test flows [DO NOT merge]Add native Codex hook support and harden install/test flows Mar 15, 2026
@shinezyy
Copy link
Copy Markdown
Contributor Author

This works only on main branch, but not on current release (0.114.0).

Don't merge until the stop hook is allowed to block the session for many times

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c35cd75c89

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

BITLESSON_MODEL="$(get_config_value "$MERGED_CONFIG" "bitlesson_model")"
BITLESSON_MODEL="${BITLESSON_MODEL:-haiku}"
CODEX_FALLBACK_MODEL="$(get_config_value "$MERGED_CONFIG" "codex_model")"
CODEX_FALLBACK_MODEL="${CODEX_FALLBACK_MODEL:-$DEFAULT_CODEX_MODEL}"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Initialize Codex fallback model before using nounset fallback

With set -u, this line dereferences DEFAULT_CODEX_MODEL before loop-common.sh is sourced, so a valid-but-empty codex_model in merged config ("codex_model": "") causes bitlesson-select.sh to abort with unbound variable before any routing logic runs. This blocks BitLesson selection (and therefore RLCR progress) for users with that config shape instead of falling back to the default model.

Useful? React with 👍 / 👎.

if not isinstance(stop_groups, list):
raise SystemExit(f"existing hooks config has invalid Stop array: {hooks_file}")

managed_pattern = re.compile(r"(^|/)humanize/hooks/(loop-codex-stop-hook\.sh|pr-loop-stop-hook\.sh)$")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Match managed hooks by filename, not hardcoded humanize path

The cleanup regex only removes existing managed Stop hooks when the command contains /humanize/hooks/...; when --runtime-root points to a custom path (supported by this script), previously installed Humanize hooks are not recognized as managed and are kept, then appended again. Re-running install in that setup duplicates stop hooks, causing multiple executions per Stop event.

Useful? React with 👍 / 👎.

- add native Codex hook config and installer, wire RLCR/PR stop hooks, and document Codex setup and usage
- fix BitLesson selector routing and update related skills/docs
- simplify install-skill target handling and harden RLCR test mock argument parsing
@shinezyy shinezyy changed the title [DO NOT merge]Add native Codex hook support and harden install/test flows Add native Codex hook support and harden install/test flows Mar 26, 2026
@shinezyy
Copy link
Copy Markdown
Contributor Author

This works on release (0.116.0).

@SihaoLiu SihaoLiu merged commit dbb88bc into PolyArch:dev Mar 28, 2026
4 checks passed
@SihaoLiu SihaoLiu mentioned this pull request Apr 21, 2026
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.

2 participants