Skip to content

fix: clarify signaling token debug semantics in project CLI - #71

Open
littleDogWang wants to merge 1 commit into
mainfrom
codex/fix-token-debug-semantics
Open

littleDogWang wants to merge 1 commit into
mainfrom
codex/fix-token-debug-semantics

Conversation

@littleDogWang

Copy link
Copy Markdown
Collaborator

Summary

project doctor treated the Console signaling Token debugging switch as token issuance capability. When the switch was off, it emitted TOKEN_CAPABILITY_DISABLED and returned exit code 2 even for an otherwise ready project. The CLI now names that status signalingTokenDebugEnabled in project show and no longer uses the debug switch as a readiness gate. The BFF wire field remains tokenEnabled for compatibility with the existing service.

Type of change

  • Bug fix (non-breaking)
  • Behavior change to an existing command (potentially user-visible)
  • Breaking change (CLI flag, exit code, JSON shape, or error.code rename/removal)

Public-contract impact

  • Adds or changes a JSON envelope shape: project show --json returns data.signalingTokenDebugEnabled instead of data.tokenEnabled. The boolean value is unchanged (true corresponds to need_token=0).
  • Renames or removes an error.code: the misleading TOKEN_CAPABILITY_DISABLED warning is removed.
  • Changes an exit code for an existing command: when that warning was the only issue, project doctor now exits 0 instead of 2.

Before: project show --json included "tokenEnabled": false; project doctor --json returned "status":"warning", "ok":false, and exit code 2 for the same project.

After: project show --json includes "signalingTokenDebugEnabled": false; project doctor --json returns "status":"healthy", "ok":true, and exit code 0 when no other issue exists. Pretty project show labels the value Signaling Token Debug.

Test plan

  • go test ./... passed in an isolated temporary checkout. The local home directory has a .agora/project.json binding that otherwise contaminates existing integration tests.
  • make lint passed its gofmt, error-code coverage, and generated-doc checks in the isolated checkout. golangci-lint was not installed, so its optional check did not run.
  • JSON and pretty project show behavior are covered by TestCLIProjectUseShowFeatureAndDoctorHappyPath.
  • Both debug-switch states are covered by TestBuildProjectDoctorIgnoresSignalingTokenDebug.

Documentation

  • CHANGELOG.md updated.
  • docs/automation.md updated with the field migration.
  • docs/error-codes.md updated to remove the warning and correct the App ID check description.

Security checklist

  • No credentials, App Certificates, tokens, or PII added to fixtures, logs, or test output.
  • No new outbound network call, user-home file write, or unsafe import.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant