Skip to content

[cosh-ng] feat: add a unified health check command #1543

Description

@kongche-jbw

Component

cosh-ng

Problem Statement

cosh-ng already runs a startup health scan, and the Linux live collector covers host, CPU, memory, disk, kernel, and service state. Users cannot run a unified health check on demand, and provider, configuration, hook, PTY, and permission checks are not presented through one consistent interface.

Proposed Solution

Add an on-demand health check backed by a shared diagnostics engine:

  • provide a cosh-shell doctor command;
  • provide /health in the interactive shell;
  • reuse the same checks and status model in both entry points;
  • include host resources, kernel, services, provider readiness, configuration, hooks, PTY support, and permissions;
  • classify results consistently as healthy, warning, or error;
  • return stable exit status semantics;
  • attach short, actionable remediation guidance to failed checks.

Alternatives Considered

Keep health checks limited to startup. Startup-only results are difficult to repeat, compare, or use in automated troubleshooting after the environment changes.

Acceptance Criteria

  • Users can run health checks from both the CLI and interactive shell.
  • Both entry points report the same checks and status semantics.
  • Provider, configuration, hooks, PTY, and permissions are included.
  • One failed check does not prevent the remaining checks from running.
  • Statuses, exit codes, and remediation messages are stable and actionable.
  • Tests cover healthy, degraded, partially unavailable, and failed environments.

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions