feat(observability): allowlist phase-label names to prevent path/secret leakage in TUI

Open Beginner friendly
#1,035 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Quiet
Tech stack
typescript
Domain
cli, observability

Research direction

Start in packages/opencode/src/session/status.ts at SessionStatus.publishPhase and inspect how warnings are logged. Review packages/tui/src/util/phase-label.ts and the existing unit-test conventions, then add coverage for an unregistered name. Done means unknown names warn and are dropped while registered phase labels continue to work.

Written by the indexing model from the issue text.

Description

Deferred from the v0.9.3 pre-release review.

Current behavior

SessionStatus.publishPhase(name, ...) in packages/opencode/src/session/status.ts accepts any string for the name argument. Today the set produced by bootstrap.* spans is static and benign, and the TUI's packages/tui/src/util/phase-label.ts falls back to "Thinking..." on unknown names.

Gap

There is no validation at the publishPhase call site that the name is limited to a registered set. A future span whose name accidentally embeds a filesystem path, a secret, or a sensitive env reference would surface as a user-visible TUI label without any signal that it was unintended.

Proposal

Add a Set<string> of known phase names. publishPhase logs a warning (not throws) when an unregistered name is used and drops the label. Cover with a unit test that asserts a warning fires on an unregistered name so a regression is loud.

Why deferred

Guardrail against a future regression; the current phase-name set is static and benign so there is no user-visible risk today.

Dominant language
TypeScript
Stars
813
Forks
134
Avg merge
2d 5h
Merged PRs (30d)
62

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from AltimateAI/altimate-code

All issues in AltimateAI/altimate-code

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.