Skip to content

audit(ui): missing field initializers across PollingHost/ChatHost/SettingsHost/ScrollHost/CompactionHost on RemoteClawApp #2496

@alexey-pelykh

Description

@alexey-pelykh

Problem

Issue A's investigation only audited LifecycleHost, GatewayHost, and ToolStreamHost — the three interfaces that surfaced as broken via gateway-disconnect symptoms. The RemoteClawApp class is also cast (via as unknown as Parameters<typeof X>[0]) to several other host interfaces:

  • PollingHost (in ui/src/ui/app-polling.ts:6)
  • ChatHost (in ui/src/ui/app-chat.ts:13)
  • SettingsHost (in ui/src/ui/app-settings.ts:40)
  • ScrollHost (in ui/src/ui/app-scroll.ts:4)
  • CompactionHost (in ui/src/ui/app-tool-stream.ts:263 — extends ToolStreamHost)

Same risk class as Issue A: any required field on these interfaces that's missing on the production class will be undefined at runtime, with no type-error or test failure.

Audit method

For each host interface listed above:

  1. Read the type definition; enumerate non-optional fields.
  2. For each non-optional field, grep ui/src/ui/app.ts for an initializer ({field} = , @state() {field}, private {field}).
  3. Report any field declared on the interface but missing on the class.

Reproducible script:

# Example for PollingHost
PHOST_FIELDS=$(awk '/^type PollingHost = \{/,/^\};/' ui/src/ui/app-polling.ts | grep -oE '^  [a-z][a-zA-Z]+:' | tr -d ':' | sed 's/^  //')
for field in $PHOST_FIELDS; do
  if ! grep -qE "(@state\(\)\s+|private\s+|public\s+|protected\s+)?${field}\s*[!?]?\s*[:=]" ui/src/ui/app.ts; then
    echo "MISSING (PollingHost): $field"
  fi
done

Repeat per interface; consolidate findings.

Acceptance criteria

  • Audit complete for all 5 listed interfaces.
  • Findings documented in PR description with field name, declaring interface, severity (fatal / latent crash / cosmetic — same taxonomy as Issue A).
  • Missing fields with non-cosmetic severity are fixed in the same PR (3-line fixes per field, matching pattern of Issue A).
  • Issue D's smoke test is extended to cover the additional host interfaces (cross-link).
  • Cosmetic-severity gaps documented but optionally deferred (note in PR which were fixed vs deferred and why).
  • pnpm tsgo, pnpm test, pnpm check all green.

Commit message

fix(ui): restore missing host-interface field initializers on RemoteClawApp — PollingHost/ChatHost/SettingsHost/ScrollHost/CompactionHost audit

Notes

Order of operation matters: this audit is more useful after Issue B (cast removal) lands, because at that point TypeScript will surface the missing fields as compile errors instead of requiring a manual audit. If Issue B is merged first, this issue may auto-close (the audit becomes "fix the new tsc errors"). Track both; close H if B's PR resolves all surfaced gaps.

References

  • Related: Issue A (3 fields found in initial investigation)
  • Related: Issue B (cast removal makes this audit unnecessary)
  • Related: Issue D (extend smoke test to cover findings)

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions