Skip to content

fix(cli): redact list inventory rows like status rows - #11821

Merged
jyaunches merged 6 commits into
mainfrom
codex/fix-list-inventory-redaction
Sep 15, 2026
Merged

jyaunches merged 6 commits into
mainfrom
codex/fix-list-inventory-redaction

Conversation

@jyaunches

@jyaunches jyaunches commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Outcome

nemoclaw list --json now redacts sandbox inventory strings that status --json already redacts. Inventory recovery metadata and text output also no longer publish secret-bearing sandbox or inference values.

Reason

The list and status surfaces exposed the same registry data with different redaction guarantees. This replacement preserves the fix proposed by @udsy19 in #10200 and adapts it to the current asynchronous policy lookup and shared inventory rendering paths.

Related issues

Fixes #10199.

Supersedes #10200.

Changes

  • Apply the existing status redactor to inventory names, inference values, policy names, agent names, live phases, and recovery metadata.
  • Share public sandbox-field projection between list and status output.
  • Route text-mode list through the recovery-backed redacting command path while preserving JSON stdout behavior.
  • Preserve raw live-versus-onboarded route drift while redacting URL credentials from displayed values.

Verification

  • npm run test:changed — passed.
  • npx vitest run --project integration test/cli/list-share-live-inference.test.ts — 14 tests passed.
  • npx vitest run --project cli src/commands/global-oclif-command-adapters.test.ts — 12 tests passed.
  • npx vitest run --project cli src/lib/inventory/index.test.ts src/lib/inventory/index-concurrency.test.ts — 63 tests passed.
  • npm run typecheck — passed.
  • Commit and push hooks — passed, including publication validation and CLI TypeScript checks.
  • Hosted CI for exact head f169d097bcdb99cbaf9fd4efe48b6dc08552d1cb — passed, including all 12 CLI shards and merged coverage.
  • Hosted PR Review Advisor run 35003266995 — all nine specialists clear and Require no Advisor blockers passed for the exact head.
  • Advisor E2E recommendation — none; all specialists classified the change as deterministic host-side projection/rendering covered by unit and CLI integration tests.

Review notes

The local PR Review Advisor could not start its first specialist. Three attempts created the OpenShell sandbox, then failed at sandbox-create-readiness with sandbox is not ready; each attempt deleted its sandbox. The alternative local review inspected the complete diff and affected sibling paths. The hosted exact-head Advisor review is authoritative and clear.


Signed-off-by: Julie Yaunches [email protected]

Summary by CodeRabbit

  • Bug Fixes
    • Sensitive sandbox and API-key-like values are now consistently redacted in inventory, list, and status information.
    • Sandbox names, inference details, policies, agent information, gateway phases, and related metadata are sanitized while preserving expected values.
    • List output now reflects live gateway inference and accurately reports route differences.
    • Inventory and status outputs remain aligned across completed and incomplete onboarding states.
    • Improved coverage helps prevent sensitive information from appearing in public inventory responses.

@jyaunches jyaunches self-assigned this Sep 15, 2026
@copy-pr-bot

copy-pr-bot Bot commented Sep 15, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: cb7aba3f-ccca-4c7d-9a61-651e0c1da8b4

📥 Commits

Reviewing files that changed from the base of the PR and between 4441208 and f169d09.

📒 Files selected for processing (5)
  • src/commands/global-oclif-command-adapters.test.ts
  • src/commands/list.ts
  • src/lib/inventory/index-concurrency.test.ts
  • src/lib/inventory/index.ts
  • test/cli/list-share-live-inference.test.ts

📝 Walkthrough

Walkthrough

Inventory and status projections now sanitize shared sandbox fields, URL credentials, inference values, and onboarding names. Non-JSON list execution now delegates to listSandboxesCommand, which handles live inference and route drift. Tests cover redaction and output consistency.

Changes

Inventory listing and output consistency

Layer / File(s) Summary
Centralize sanitized inventory projections
src/lib/inventory/index.ts
Shared projection logic sanitizes inventory and status fields, including URLs, names, inference values, policies, agents, and dashboard ports.
Route live listing through inventory command
src/commands/list.ts, src/lib/inventory/index.ts
Non-JSON listing delegates to listSandboxesCommand, which loads recovery once, resolves live inference, computes route drift, and renders the result.
Validate output and command integration
src/lib/inventory/index-concurrency.test.ts, test/cli/list-share-live-inference.test.ts, src/commands/global-oclif-command-adapters.test.ts
Tests verify credential redaction, live inference display, matching and differing routes, onboarding consistency, and command delegation.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix · Severity of issue fixed: Medium

Sequence Diagram(s)

sequenceDiagram
  participant ListCommand
  participant listSandboxesCommand
  participant LiveInference
  participant InventoryRenderer
  ListCommand->>listSandboxesCommand: delegate non-JSON listing
  listSandboxesCommand->>LiveInference: resolve live inference
  LiveInference-->>listSandboxesCommand: return live model and provider
  listSandboxesCommand->>InventoryRenderer: render sanitized values and route drift
  InventoryRenderer-->>ListCommand: return list output
Loading

Merge Risk: ⚪ Minimal · up to 44412

No merge-blocking issue was identified in the inventory redaction change.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Issue #10199 requires nemoclaw list --json to redact sandbox names, model, provider, policies, and agent fields like status --json. At the reviewed head, buildSandboxInventoryRow applies `safeSt…
Out of Scope Changes check ✅ Passed The changes stay within issue #10199. The extra redaction covers related sandbox inventory metadata and recovery names, which prevents the same raw-value exposure on adjacent list --json fields. The…
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: redact CLI inventory rows consistently with status rows.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-list-inventory-redaction

Comment @coderabbitai help to get the list of available commands.

@jyaunches

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@github-code-quality

github-code-quality Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall line coverage in commit f169d09 in the codex/fix-list-inven... branch remains at 96%, unchanged from commit 5310ad0 in the main branch.

TypeScript / code-coverage/cli

The overall line coverage in commit f169d09 in the codex/fix-list-inven... branch remains at 83%, unchanged from commit 5310ad0 in the main branch.

Show a line coverage summary of the most impacted files.
File main 5310ad0 codex/fix-list-inven... f169d09 +/-
src/lib/security/redact-url.ts 100% 99% -1%
src/lib/messagi...nnels/policy.ts 98% 97% -1%
src/lib/inventory/index.ts 93% 93% 0%
src/commands/list.ts 100% 100% 0%
src/lib/agent/defs.ts 97% 97% 0%
src/lib/agent/s...ory-contract.ts 97% 97% 0%
src/lib/sandbox...rce-identity.ts 82% 82% 0%
src/lib/securit...ntial-filter.ts 96% 96% 0%
src/lib/onboard...uild-context.ts 74% 75% +1%

Updated September 15, 2026 17:45 UTC

@github-actions

Copy link
Copy Markdown
Contributor

PR Review Advisor finished for commit f169d09. Include the Advisor findings in the complete PR feedback collection. Verify and group valid findings before repair.

Request review only when Require no Advisor blockers is green.

All previous runs

@jyaunches
jyaunches marked this pull request as ready for review September 15, 2026 18:02
@jyaunches
jyaunches merged commit 28232ba into main Sep 15, 2026
67 of 68 checks passed
@jyaunches
jyaunches deleted the codex/fix-list-inventory-redaction branch September 15, 2026 18:02
cv pushed a commit that referenced this pull request Sep 18, 2026
<!-- markdownlint-disable MD041 -->
## Outcome

OpenShell inference route reads now flow through one typed observer for
the accepted first slice of #9809. Existing gateway targeting, native
lifecycle behavior, list/status redaction, and external command behavior
remain unchanged.

## Reason

Inference consumers independently constructed `openshell inference get`
commands and interpreted raw CLI results. Centralizing the read boundary
gives each consumer the same scoped, typed, and redacted observation
without changing mutation or recovery behavior.

### Related issues

Refs #9809

## Changes

- Add typed configured and unconfigured observations plus distinct
validation, authentication, timeout, schema, transport, and command
failures.
- Keep named-gateway scoping, bounded capture, control-sequence cleanup,
endpoint-override refusal, and the base gateway's legacy output
compatibility inside the OpenShell adapter.
- Migrate the accepted CLI, onboarding, connect, readiness, doctor,
inventory, status, and config-export readers to typed results.
- Remove the superseded production reader and protect the boundary with
adapter and consumer tests.

Route mutation and rollback (#11738), plugin transport (#9813),
generated gRPC transport (#9828), credentials, provider or gateway
lifecycle changes, new routing semantics, status lifecycle suppression,
and live E2E remain excluded.

## Verification

- `NODE_OPTIONS=--max-old-space-size=8192 npm run typecheck:cli` —
passed.
- `npm run checks:repository` — all 19 repository checks passed with no
architecture cycles.
- Focused CLI unit selection — 16 files and 377 tests passed, covering
the adapter and migrated source consumers.
- Focused integration selection — 8 files and 157 tests passed; the
status JSON integration suite passed 21/21.
- `npm run test:changed` — 3,182 tests passed. The route-observation
acceptance set is complete with no candidate-owned failure. Two
process-heavy suites were classified environmental after focused replay;
`snapshot-auto-create-failure` passed 4/4 unchanged and
`runtime-provider-contract` passed 75/75 with a 15-second local
diagnostic timeout.
- The remaining launch group was classified inherited: 18 cases fail
with the same sandbox-replacement journaling error on this candidate and
on exact base `3c6591ddba4a321ab8e6b766203e44d6e3b8002e`; this PR
changes none of the three owning launch/probe files.
- Commit hooks passed, including repository structure, formatting, lint,
tests selected by the commit, DCO, and secret checks.
- The diff contains no secrets, API keys, or credentials.

No live E2E is required because the accepted behavior is fully
observable at deterministic adapter and consumer boundaries and does not
mutate external state.

## Review notes

Sensitive inference and onboarding paths are changed. Pre-publication
review covered exact gateway targeting, refusal of endpoint overrides,
bounded capture, typed failure separation, redaction, current lifecycle
ownership, and the criterion-to-evidence ledger. The refreshed head
still requires exact-head CodeRabbit, PR Review Advisor, CI, and human
approval before merge.

The current-main refresh incorporates related lifecycle and
test-contract changes from #11741, #11776, #11792, #11821, #11829,
#11865, #11889, #11891, #11908, and #11913 without expanding this PR's
behavior.

Accepted scope:
#9809 (comment)

---
Signed-off-by: Rebecca Sliter <[email protected]>


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **New Features**
- Added structured inference-route checks for configured and
unconfigured gateways.
  - Improved support for named gateways and provider/model verification.
- Added clearer handling for timeouts, authentication, connectivity,
validation, and schema errors.
- Improved sandbox connection, launch readiness, status, onboarding, and
recovery flows with verified route information.

- **Bug Fixes**
- Prevented untrusted or unavailable inference routes from being treated
as healthy.
- Added recovery guidance and preserved relevant failure details when
restoration cannot be confirmed.

- **Documentation**
- Documented inference-route behavior, gateway scoping, sanitization,
timeouts, and error reporting.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Rebecca Sliter <[email protected]>
Signed-off-by: San Dang <[email protected]>
Co-authored-by: Rebecca Sliter <[email protected]>
Co-authored-by: San Dang <[email protected]>
@wscurran wscurran added area: cli Command line interface, flags, terminal UX, or output area: security Security controls, permissions, secrets, or hardening bug-fix PR fixes a bug or regression labels Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cli Command line interface, flags, terminal UX, or output area: security Security controls, permissions, secrets, or hardening bug-fix PR fixes a bug or regression

Projects

None yet

Development

Successfully merging this pull request may close these issues.

list --json publishes sandbox fields raw that status --json redacts

2 participants