Dashboard › cli › Distillation
dfd6a020-ba83-403d-b0b0-7c6e90d44972["lore_tm_v1_n-7ml4an6JEBXn-CsQ_-4Qq5VcDxZwNUck8RzzDavlo","lore_tm_v1_FnjWlAuaKTGtPVvnH4y-aEkYcBrLXfQypmSXL3OSPwM","lore_tm_v1_JZE55_yK75Ul8m-RGqrgdYS26oeXwtylbkLJaM6wjIQ"]
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/commands/agent-conversation/list.test.ts is a 475-line Vitest suite for sentry agent-conversation list; it mocks api-client.js, db/auth.js, polling.js, resolve-target.js, and db/pagination.js by wrapping exported functions with vi.fn, then uses spyOn for listConversations, getAuthConfig, withProgress, resolveOrg, resolveCursor, advancePaginationState, and hasPreviousPage.ORG = "test-org", /tmp as cwd, auth token "sntrys_test" with source "oauth", a default limit: 25, fresh: false, and period: parsePeriod("7d"); JSON_FLAGS sets json: true and HUMAN_FLAGS sets json: false.makeConversation() defaults to conversation ID "conv-abc-123", flow ["agent"], errors: 0, llmCalls: 5, toolCalls: 3, totalTokens: 500, totalCost: 0.01, timestamps 1_716_500_000β1_716_500_060, traceCount: 1, trace ID "aaaa1111bbbb2222cccc3333dddd4444", input "Hello world", output "Goodbye", user ID "1" / email "test@example.com" / username "testuser" / null IP, tool ["search"], and toolErrors: 0.sampleConversations contains 2 records: the default "conv-abc-123" fixture and "conv-def-456" with first input "Second conversation" and totalTokens: 1200.ORG is passed through resolveOrg({ org: ORG }), omitted organization is resolved from { org: undefined } to "auto-org", unresolved organization throws ContextError, and the error carries canonical usage sentry agent-conversation list [<org>].data, hasMore, 2 array entries, and first conversationId: "conv-abc-123"; human output must contain the surviving truncated ID prefix "conv-" and organization."has:errors", parsePeriod("24h") becoming statsPeriod: "24h", and limit: 50 to reach listConversations.-c next and -q "has:errors"; no results without a cursor render No agent conversations found, while no results with "some-cursor" render No conversations on this page.hasMore: true and nextCursor: "cursor-123" when a next cursor exists, and hasMore: false when absent.advancePaginationState("agent-conversation-list", expect.any(String), "next", "next-cursor")./home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/lib/command.test.ts is a 1,920-line command-builder test suite; its createTestContext() exposes shared writable process.stdout and stdout, plus collected output and errors arrays.init -y β disabled, 2. init -n β disabled, 3. init --yes=false β enabled, 4. data -n 10 where -n aliases limit β enabled, and 5. data -y 2 where -y aliases row β enabled.buildCommand() tests verify __primaryUsage retains "<name>:<kind>...", __examples retains { description: "Select an organization explicitly", command: "sentry thing list my-org" }, and numberParser is re-exported as a function.--verbose --limit 50 reaches the original function as { verbose: true, limit: 50 } and emits Sentry tags "flag.verbose" = "true" and "flag.limit" = "50"; default-false booleans produce no flag.* tags.default: "10" and parse: numberParser reaches the command as numeric 10, not string "10"."PROJECT-123" is passed to the command and recorded via Sentry.setContext("args", { values: ["PROJECT-123"], count: 1 }); tests also verify preservation of the commandβs this context and awaiting an async command that sleeps for 1 ms.applyLoggingFlags() tests map "debug" and verbose: true to logger level 4, give explicit logLevel priority so "error" plus verbose yields level 0, leave the level unchanged when both are unset/false, and map every LOG_LEVEL_NAMES entry to its array index.--verbose sets debug level 4, --log-level trace sets level 5, and equals-form --log-level=error sets level 0.--log-level is always stripped because it is wrapper-owned; even when a command owns --verbose, the command receives its own verbose: true while "log-level" remains absent.--verbose flag with brief "Show HTTP details" is preserved for command semantics and also triggers debug-level logging as a side effect; if combined with --log-level trace, the explicit log level takes priority and logger level is 5.--verbose --log-level debug --limit 50 receives limit: 50 but neither verbose nor "log-level" when those logging flags are wrapper-injected.JSON_FLAG is tested as a visible boolean with default: false; FIELDS_FLAG is tested as an optional parsed flag whose parse("id,title") returns "id,title".buildCommand() automatically accepts and injects --json and --fields when output: { human: () => "unused" } is configured.test/script/generate-skill-markdown.test.ts:57 contains "**Examples:**"; test/lib/introspect.test.ts:212, :234, and :274 cover fullDescription and __examples; test/lib/command.test.ts:186, :204, and :222 cover customUsage and retained structured examples.