Skip to content

[macos] Surface provider diagnostics and redacted launch context #97

Description

@100yenadmin

Parent epic: #82
Related: #95, #96
Sprint: v0.3 Sprint 1 - App, Combat, Deterministic Gates

Summary

Make provider failures debuggable from the native app. When Claude/Codex/OpenClaw launch, fail, or exit, the app should surface the resolved command, provider kind, run id, selected port, state root, exit status, last error, and last log lines without exposing secrets.

Architecture invariant

Diagnostics are observational. The app may supervise processes and display logs, but it must not repair campaign state, rewrite provider configs, or mutate engine snapshots.

Code map

  • macos/ClawDnDApp/Sources/ClawDnDApp/Services/AppProcessService.swift: record provider command metadata, exit status, and timestamps.
  • macos/ClawDnDApp/Sources/ClawDnDApp/Services/ProviderAdapters.swift: expose a redacted launch summary from ProviderLaunchRequest.
  • macos/ClawDnDApp/Sources/ClawDnDApp/Views/ProvidersView.swift: show provider setup and launch status.
  • macos/ClawDnDApp/Sources/ClawDnDApp/Views/LogsView.swift: include provider diagnostics and copy diagnostics.
  • macos/ClawDnDApp/Sources/ClawDnDApp/Services/Diagnostics.swift: centralize redaction.

Redaction requirements

Do not display raw environment dumps. Redact or omit values whose keys contain:

  • KEY
  • TOKEN
  • SECRET
  • PASSWORD
  • AUTH
  • COOKIE

Budget caps, world id, run id, local port, provider kind, and repo path are okay to display.

Acceptance criteria

  • Failed provider launch shows actionable native UI text.
  • Provider logs include exit status and last N lines.
  • Copy diagnostics includes dependency status and redacted provider metadata.
  • No secrets are exposed in logs or copied diagnostics.
  • Existing Claude launch path remains unchanged.

Focused validation

cd /Volumes/LEXAR/repos/ClawDnD
swift build --package-path macos/ClawDnDApp
./script/build_and_run.sh --verify

Manual smoke:

  1. Configure Codex provider command to false and start it.
  2. Confirm the app reports a failed provider process with command context and no secrets.
  3. Configure Codex provider command to scripts/provider_contract_smoke.sh after [macos] Add provider contract smoke adapter for Codex/OpenClaw commands #95 and confirm diagnostics show a clean exit.

Original-agent handoff

Inspect these first:

  • macos/ClawDnDApp/Sources/ClawDnDApp/Services/AppProcessService.swift
  • macos/ClawDnDApp/Sources/ClawDnDApp/Services/Diagnostics.swift
  • macos/ClawDnDApp/Sources/ClawDnDApp/Views/LogsView.swift

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesttier-1Tier 1: Claude Code plugin

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions