Repository navigation
Hide unlabeled legacy traces from default CLI discovery - #23
maxdeichmann wants to merge 2 commits into
Conversation
Rename unversioned deprecated resources to legacy-*-v1, omit them from default help/schema unless --include-deprecated, and label remaining help with Cloud removal plus the Observations API v2 recipe. Self-hosted v3 snapshots keep traces as current commands. Co-authored-by: Max Deichmann <max@langfuse.com>
| .replace(/^\*\*Deprecated:?\*\*\s*/i, "") | ||
| .replace(/^Deprecated:?\s*/i, "") |
There was a problem hiding this comment.
🟡 (optional) Users now see raw **Deprecated.** markdown leak into CLI error and help text for operations whose OpenAPI description uses the period style (e.g. Prompts). The regex was changed from /^\*\*Deprecated\.\*\*\s*/i to /^\*\*Deprecated:?\*\*\s*/i (and similarly for the plain-text variant), which only strips a colon or no punctuation after "Deprecated", not a period, so descriptions like "Deprecated. Use GET /api/public/v3/prompts instead." (still used in src/cli.test.ts:232) are no longer stripped. Fix: match both . …
Extended reasoning...
…and : (or make the punctuation optional/any), e.g. /^\*\*Deprecated[.:]?\*\*\s*/i and /^Deprecated[.:]?\s*/i, so both legacy period-style and new colon-style deprecation descriptions are stripped in assertOperationCallable and printOperationHelp.
explicitDeprecationNote (src/cli.ts:357-366) is called from assertOperationCallable (src/cli.ts:402) and printOperationHelp (src/cli.ts:518). It takes operation.description, splits on blank line, then strips a leading 'Deprecated.' or 'Deprecated.' marker before returning the human note. The new regexes only allow an optional colon between 'Deprecated' and the closing '' (or a colon after plain 'Deprecated'), not a period. For description 'Deprecated. Use GET /api/public/v3/prompts instead.' neither regex matches at position 0 (string starts with '' then 'Deprecated.' — period breaks the :? branch, and the plain-text regex also anchors at '^Deprecated' which fails because the string actually starts with '**'). So the full raw string, including the literal markdown bold markers and period, is returned unstripped…
Verification: normal (cosmetic regression): The diff changed src/cli.ts:364-365 from /^\*\*Deprecated\.\*\*\s*/i + /^Deprecated\.?\s*/i to /^\*\*Deprecated:?\*\*\s*/i + /^Deprecated:?\s*/i. The new markdown-variant regex requires **Deprecated followed by an optional colon and then **; it does NOT match the period style **Deprecated.** (after Deprecated the next char is ., so…
There was a problem hiding this comment.
Fixed. explicitDeprecationNote now matches **Deprecated.** and **Deprecated:** (and the plain-text equivalents), and the prompts test asserts the error no longer contains the markdown marker.
The OpenAPI note parser must accept **Deprecated.** as well as **Deprecated:** so CLI errors do not leak markdown. Co-authored-by: Max Deichmann <max@langfuse.com>
Agents were treating
tracesas a current resource because defaultapi schema/ help listed it next toobservationsandlegacy-observations, with summaries like “Get list of traces”. There was nolegacy-traces-v1name, so generated clients followedtraces list/trace get.Changes
legacy-<resource>-v1(so GET traces islegacy-traces-v1, matchinglegacy-observations-v1).api helpandapi schema --jsonomit deprecated Cloud v3 operations. Pass--include-deprecatedto list them, or--api-version 3for self-hosted v3 snapshots wheretraces listremains a current command.deprecated; Cloud removal 2026-11-16; use observations list / Observations API v2.traces listkeep resolving so the error names the replacement instead of “unknown action”.Out of scope
SDK docstrings (
api.trace.*,fetch_trace*) live in the Langfuse SDK repos, not this CLI.Verification
bun testandbun run typecheckbun run goldens:updatefor 4.10.0 / 4.35.0 command surfacesbun run conformance:all— 596/596tracesdelete-only (no list/get),legacy-traces-v1only with--include-deprecated, and--api-version 3still exposestraces list/get