Commit Graph

48763 Commits

Author SHA1 Message Date
sallyom
f65251d0ec docs: note tool result detail redaction 2026-05-12 20:13:26 -04:00
nimbleenigma
277eb16652 fix: redact persisted tool result details
Refresh PR #80444 on current upstream main.
2026-05-12 20:13:26 -04:00
Peter Steinberger
250c26d02c test: dedupe backup verify mock read 2026-05-13 01:12:49 +01:00
Peter Steinberger
bf92aa7bc0 test: dedupe doctor browser mock read 2026-05-13 01:11:45 +01:00
Peter Steinberger
c6249e4809 test: dedupe doctor transcript mock read 2026-05-13 01:10:22 +01:00
Peter Steinberger
fccee9485c test: dedupe status service mock read 2026-05-13 01:09:16 +01:00
Peter Steinberger
4b33ade05e test: dedupe doctor auth mock read 2026-05-13 01:08:06 +01:00
Peter Steinberger
cf77ad5025 test: dedupe backup mock read 2026-05-13 01:06:38 +01:00
Peter Steinberger
9147a53274 fix: normalize nested gemini preview config ids 2026-05-13 01:05:25 +01:00
Peter Steinberger
f8953d94bd test: dedupe nodes tool mock read 2026-05-13 01:01:32 +01:00
Peter Steinberger
b8c0edf91c test: dedupe gateway tool mock read 2026-05-13 00:59:30 +01:00
Peter Steinberger
6d631d3adf test: dedupe cron tool mock read 2026-05-13 00:58:26 +01:00
Peter Steinberger
93a81865f0 test: dedupe embedded subscribe warning read 2026-05-13 00:56:52 +01:00
Peter Steinberger
5147d2849f test: dedupe coding tools mock read 2026-05-13 00:55:45 +01:00
Peter Steinberger
8830527536 test: dedupe model catalog mock read 2026-05-13 00:54:38 +01:00
Peter Steinberger
30442d9e4e test: dedupe pi project settings mock read 2026-05-13 00:53:31 +01:00
sallyom
14a9bb98b7 fix(config-audit): guard scrub rename after temp write
Signed-off-by: sallyom <somalley@redhat.com>
2026-05-12 19:52:52 -04:00
YB0y
432b94989b fix(config-audit): scrub pre-redactor argv values from historical config-audit.jsonl entries (#80777)
PR #75095 added `redactConfigAuditArgv` so newly-written entries in
`~/.openclaw/logs/config-audit.jsonl` mask token-shaped values, but the
audit log has no rotation, retention, or one-shot scrub. Users who ran
`openclaw config set <path> <secret-value>` between commit `748d6821d2`
(audit added 2026-02-14) and `a853c5e8c2` (redactor merged 2026-05-01)
still have plaintext Slack, Telegram, gateway, etc. tokens sitting in
`config-audit.jsonl` at rest after upgrading.

Add `scrubConfigAuditLog` in `src/config/io.audit.ts` that reads the
audit log, rewrites every record's `argv` / `execArgv` fields through
the existing forward redactor, and writes the file back atomically
(`*.scrub.tmp` + rename, mode 0o600). Idempotent — already-masked
entries pass through unchanged. Malformed lines are preserved verbatim
and counted as `skipped` so the scrub never destroys forensic content
it cannot understand. Concurrent-append guard: re-stat the audit log
immediately before rename and abort (no on-disk change) if the file
grew during the scrub, so a parallel appendConfigAuditRecord call is
never overwritten by the rename swap. Wire into the doctor health flow
as `runConfigAuditScrubHealth`: scan-only on a normal `openclaw doctor`
(prints the count and suggests `--fix`); rewrite atomically on
`openclaw doctor --fix` with a "rotate any credentials" note; print a
"stop the gateway and rerun" hint on the abort path. No plaintext
backup file is produced; file mode and parent dir mode are preserved.

Per repo CLAUDE.md ("Legacy config repair: doctor/fix paths, not
startup/load-time core migrations") the scrub is gated to `--fix`
and runs only when the user opts in.

Verified:
- pnpm install --frozen-lockfile
- pnpm test src/config/io.audit.test.ts
- pnpm test src/commands/doctor-config-flow.test.ts
- pnpm tsgo:core:test
- pnpm exec oxfmt --check --threads=1 src/config/io.audit.ts src/config/io.audit.test.ts src/commands/doctor-config-audit-scrub.ts src/flows/doctor-health-contributions.ts

Closes #80777
2026-05-12 19:52:52 -04:00
Peter Steinberger
9ae29c8bb1 test: dedupe pi tools schema mock read 2026-05-13 00:52:27 +01:00
Sarah Fortune
48529f1a96 feat(onboard): offer codex migration after harness install (#81192)
Add a post-install seam so the wizard can prompt the user to import their
existing Codex CLI state (skills, archived config/hooks, advisory cached
plugins) through the existing `openclaw migrate codex` flow once the
harness plugin is in place. Fires on both fresh installs and repair runs;
the user can decline at any time.

Trigger sites, both routing through one helper:

- src/plugins/provider-auth-choice.ts: after
  `ensureCodexRuntimePluginForModelSelection` reports `installed: true`,
  dynamically import `offerPostInstallMigrations` and call it before the
  wizard moves on.
- src/commands/onboard-non-interactive/local/auth-choice.plugin-providers.ts:
  same call shape with `nonInteractive: true`, so the helper emits a hint
  line only and never mutates state.

Helper (src/wizard/setup.post-install-migration.ts) is generic, not
Codex-hardcoded — it resolves migration providers via the manifest
`migrationProviders` contract, filters to providers owned by plugins the
caller flags as installed in this onboarding step, runs `provider.detect`,
and on TTY hands accepted runs to `migrateDefaultCommand`. All detect,
prompt, and migrate failures are swallowed so onboarding never aborts on
this optional offer.

Also harden the Codex app-server subprocess lifecycle now that `detect()`
runs from a hotter onboarding path: isolate the plugin-install
`plugin/read` call (extensions/codex/src/migration/apply.ts) and have the
isolated request wait for child exit with a SIGKILL fallback
(extensions/codex/src/app-server/request.ts) so parents are not held open
by an orphaned codex binary.

Tests:

- src/wizard/setup.post-install-migration.test.ts (new, 10 cases)
- src/commands/onboard-non-interactive/local/auth-choice.plugin-providers.test.ts
  extended with hint-call assertions and a not-required-no-offer case.
2026-05-12 16:51:27 -07:00
Peter Steinberger
37237a5129 test: dedupe auth profile mock read 2026-05-13 00:50:55 +01:00
Peter Steinberger
ce21937c97 test: dedupe cli helper mock read 2026-05-13 00:49:56 +01:00
Peter Steinberger
20e2206eac test: dedupe exec followup mock reads 2026-05-13 00:48:42 +01:00
Peter Steinberger
21a46f48d2 test: dedupe pi tool adapter log reads 2026-05-13 00:47:32 +01:00
Peter Steinberger
1ade7a53af test: dedupe cron scope mock reads 2026-05-13 00:43:49 +01:00
Peter Steinberger
f2935ca3ec test: dedupe sandbox manage mock reads 2026-05-13 00:41:53 +01:00
Peter Steinberger
a0833ed20b test: dedupe skills install mock reads 2026-05-13 00:40:42 +01:00
Peter Steinberger
9c3e08b346 test: dedupe subagent announce mock reads 2026-05-13 00:39:10 +01:00
Peter Steinberger
7964a49378 test: dedupe subagent spawn mock reads 2026-05-13 00:37:52 +01:00
Peter Steinberger
5051024366 test: dedupe subagent thread mock reads 2026-05-13 00:36:47 +01:00
Peter Steinberger
b540882703 test: dedupe music generate mock reads 2026-05-13 00:35:16 +01:00
Peter Steinberger
3c27f7428b test: dedupe cf markdown mock reads 2026-05-13 00:33:58 +01:00
Peter Steinberger
3436fc2f72 test: dedupe web search mock reads 2026-05-13 00:32:48 +01:00
Peter Steinberger
caa4cf7f0f test: dedupe web fetch mock reads 2026-05-13 00:31:44 +01:00
Peter Steinberger
0e4f2c53c7 test: dedupe command control mock reads 2026-05-13 00:30:24 +01:00
Peter Steinberger
df7a71afc6 test: dedupe agent runner execution mock reads 2026-05-13 00:29:14 +01:00
Peter Steinberger
b3cc2c17fc test: dedupe secret resolution mock reads 2026-05-13 00:27:20 +01:00
Peter Steinberger
a7b9bce139 test: dedupe acp command mock reads 2026-05-13 00:25:54 +01:00
Peter Steinberger
33419d7d1b test: dedupe commands core mock reads 2026-05-13 00:21:44 +01:00
Peter Steinberger
ba625e2cff test: dedupe models command mock reads 2026-05-13 00:18:15 +01:00
Peter Steinberger
f2b560ff5d test: dedupe session restart mock reads 2026-05-13 00:16:04 +01:00
Peter Steinberger
b46e5ae60c test: dedupe session usage mock reads 2026-05-13 00:13:54 +01:00
Peter Steinberger
0b165f708f test: dedupe subagents focus mock reads 2026-05-13 00:11:14 +01:00
Peter Steinberger
65d801cf8a test: dedupe reply dispatch mock reads 2026-05-13 00:09:13 +01:00
Peter Steinberger
e15cce76c7 test: dedupe get reply mock reads 2026-05-13 00:06:48 +01:00
Peter Steinberger
73e47fc6a9 test: dedupe session lifecycle mock reads 2026-05-13 00:04:44 +01:00
Peter Steinberger
f96cfeeb73 test: dedupe gateway cli mock reads 2026-05-13 00:02:45 +01:00
Peter Steinberger
86c4482c58 test: dedupe message thread mock reads 2026-05-13 00:01:15 +01:00
Peter Steinberger
8998e536fa test: dedupe cli route mock reads 2026-05-12 23:59:23 +01:00
Peter Steinberger
1cd736afd2 test: dedupe update cli mock reads 2026-05-12 23:57:58 +01:00