From 33d16f0252d076ff9aba14b74a120f8be998c2b6 Mon Sep 17 00:00:00 2001 From: Joseph Mikhail <56614593+josephismikhail@users.noreply.github.com> Date: Thu, 11 Jun 2026 09:12:11 -0700 Subject: [PATCH] feat(hooks): skip expected Pro-feature prompts in local error capture MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ix_capture_async now ignores messages that are expected "needs Ix Pro" prompts ("requires Ix Pro", "Install @ix/pro", "is a Ix/pro feature", "premium features") instead of logging them to the local error store as if they were real failures. This is the still-useful half of the closed #3: that PR also de-duped the auto-GitHub-issue reporting, but commit 68e9391 removed GitHub reporting entirely (errors are now local-only), so only the Pro-message filter is relevant. Mirrors the equivalent filter merged in ix-openclaw-plugin#2. Verified: bash -n clean; a Pro prompt + a real error through ix_capture_async logs only the real error; tests/test_hooks.sh result is unchanged vs main (81 passed, 2 failed — both pre-existing env failures in the `unavailable` group, identical on a clean checkout). Co-Authored-By: Claude Opus 4.8 (1M context) --- hooks/ix-errors.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/hooks/ix-errors.sh b/hooks/ix-errors.sh index 57a825f..c09dc7a 100755 --- a/hooks/ix-errors.sh +++ b/hooks/ix-errors.sh @@ -57,6 +57,17 @@ _ixe_store_local() { >> "${IX_ERROR_STORE}/errors.jsonl" 2>/dev/null } +# ── Pro feature detection ───────────────────────────────────────────────────── +# Returns 0 if the message/stderr is an expected "needs Ix Pro" prompt (shown +# when Pro isn't installed) rather than a real error worth logging. +_ixe_is_pro_feature_msg() { + case "$1 $2" in + *"requires Ix Pro"*|*"Install @ix/pro"*|*"is a Ix/pro feature"*|*"premium features"*) + return 0 ;; + esac + return 1 +} + # ── Public: capture and log locally (fire-and-forget) ───────────────────────── # Usage: ix_capture_async [cmd_summary] [stderr] # type: plugin | ix | integration | unknown @@ -67,6 +78,10 @@ ix_capture_async() { local _type="$1" _comp="$2" _msg="${3:-unknown error}" \ _ec="${4:-1}" _cmd="${5:-}" _stderr="${6:-}" + # Skip expected Pro feature messages — these are prompts shown when Pro isn't + # installed, not actual errors. + _ixe_is_pro_feature_msg "$_msg" "$_stderr" && return 0 + ( set +e local cmsg cstderr ccmd fp