The JWT chain scanner only accepted a header at the start of a segment or
after `-`, so `session_<JWT>` reached the audit and cost logs unredacted.
Treat `_` as a prefix boundary too and cover it in the tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The lookbehind added to keep the JWT scan linear also skipped tokens right
after a `-`, so `--cookie "session=jwt-<JWT>"` reached the logs unredacted.
Scan each `[A-Za-z0-9_.-]` run once instead, checking every dot segment for
a header at its start or after a `-`, decoding at most once per segment so
long `ey-ey-...` runs stay linear.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A later batch save advances evaluated_at past edits to previously evaluated skills. Compare each saved evaluation mtime to the current inventory, including timestamps that move backward, and retain the legacy global timestamp fallback.
commands-core copies scripts/lib into the Claude config root, so it does not repair a marketplace plugin installation. Lead with a direct dashboard run from a full checkout and keep commands-core as the non-marketplace reinstall path.
Co-Authored-By: TRAE <noreply@trae.ai>
The diagnostic always blamed scripts/lib/skill-evolution, hiding a nested failure such as a missing lib/utils.js, and the printed installer command selected no module. Include the module from the resolution error and point at a full-checkout install with --modules commands-core.
Co-Authored-By: TRAE <noreply@trae.ai>
- Replace the secret=/api_key= value regex with a single-pass, quote-aware
scanner so the whole Bash word is redacted when quoted and unquoted
fragments are joined (e.g. --secret='prefix-'suffix), while a value inside
an enclosing quoted string stops at that string's closing quote.
- Searching for the keyword itself (grep -n "secret =" file,
rg 'api_key:' dir) no longer redacts the rest of the command.
- Use a lookbehind instead of \b before the JWT header so long dot-free
ey-ey-... runs are scanned in linear time instead of quadratic.
- Add regression tests for joined fragments, keyword searches, and the
ey- performance case.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A managed plugin install can lack scripts/lib/skill-evolution, which made skills-health fail on the first require with Cannot find module. Catch that specific resolution failure and print the install-apply remedy; other errors still propagate.
Co-Authored-By: TRAE <noreply@trae.ai>
Match JWT headers that start with ey or ew (whitespace after the opening
brace) and keep non-eyJ matches only when the header does not decode to
an object with an alg field. Parse secret= / api_key= values with escaped
double quotes, $'...' quoting and backslash escapes, and redact an
unterminated quoted value to the end of the command.
Refs #3846
sanitizeCommand only redacted keyword- or flag-shaped secrets, so a bare
Anthropic/OpenAI sk- key, a JWT, a PEM private key block, or a secret= /
api_key= / x-api-key: value was written verbatim to bash-commands.log and
cost-tracker.log. Add value-shape patterns for these and keep the key name
and separator for assignments so the log stays readable.
Refs #3846
On Windows, piped stdout defaults to cp1252, so `python3 gacha.py` crashed
on its first banner line with UnicodeEncodeError. That covers agent shell
tools and gacha.sh. Reconfigure stdout to UTF-8 before main(), the same
approach instinct-cli.py took for #1855.
The existing tests set PYTHONUTF8=1, which hid the crash. The new case
forces PYTHONIOENCODING=cp1252 without PYTHONUTF8, so it reproduces on any
OS: it fails on the previous gacha.py and passes with this change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collect string-valued manifest.hooks as a file reference so missing files, directories, and paths outside the cache fail validation. Add regression coverage for valid and invalid hook references while preserving non-string and absent-hook behavior.
Closes#3786
The compiled OpenCode tools import `tool` from `@opencode-ai/plugin/tool`
at module top level, and the hooks plugin imports those tools statically.
The package was only a devDependency, so production installs (OpenCode's
npm plugin cache, `npm install --omit=dev`) could not resolve it and the
whole plugin failed to load.
Move it to `dependencies` and add a build-opencode regression test that
fails when the built bundle imports a package not declared as a runtime
dependency.
Fixes#3543
(cherry picked from commit 106024070e)
openBrowser() captures the launcher's async error internally, so a missing
xdg-open/open left headless users with no hint why no browser appeared.
Wrap the injected spawn in the entrypoint to report the failure on stderr
with the dashboard URL; the shared platform-launch helper is unchanged.
The auto-open in the dashboard-web.js entrypoint spawned xdg-open/open
without an 'error' listener. When the launcher is missing (headless
Linux, containers, many WSL setups) spawn reports ENOENT asynchronously,
the try/catch cannot see it, and the unhandled 'error' event kills the
process right after the banner is printed.
Use the shared openBrowser() helper from scripts/lib/platform-launch.js,
which already handles the child's error event and unrefs the launcher,
as plan-canvas.js and control-pane.js do.
Fixes#3600