Skip to content

fix(logs): wire up cli telemetry and model user errors#1460

Open
Hweinstock wants to merge 2 commits into
aws:mainfrom
Hweinstock:fix/logs-error-modeling
Open

fix(logs): wire up cli telemetry and model user errors#1460
Hweinstock wants to merge 2 commits into
aws:mainfrom
Hweinstock:fix/logs-error-modeling

Conversation

@Hweinstock
Copy link
Copy Markdown
Contributor

@Hweinstock Hweinstock commented Jun 3, 2026

Description

Two changes to improve telemetry coverage for the logs command:

  1. Wire up CLI telemetry (commands/logs/command.tsx): handleLogs and handleLogsEval are now wrapped in withCommandRunTelemetry. Before this, only the interactive TUI path emitted cli.command_run; the CLI path recorded nothing.

  2. Model user errors (tui/screens/logs/useLogsFlow.ts): Two conditions that returned plain new Error(...) now return ValidationError.

Related Issue

Closes #

Documentation PR

N/A

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Other (please describe):

Testing

How have you tested the change?

  • I ran npm run test:unit and npm run test:integ
  • I ran npm run typecheck
  • I ran npm run lint
  • If I modified src/assets/, I ran npm run test:update-snapshots and committed the updated snapshots

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the
terms of your choice.

@github-actions github-actions Bot added the size/xs PR size: XS label Jun 3, 2026
@Hweinstock Hweinstock deployed to e2e-testing June 3, 2026 23:31 — with GitHub Actions Active
@github-actions github-actions Bot added the agentcore-harness-reviewing AgentCore Harness review in progress label Jun 3, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Jun 3, 2026
@agentcore-devx-automation
Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Jun 3, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 3, 2026

Package Tarball

aws-agentcore-0.17.0.tgz

How to install

gh release download pr-1460-tarball --repo aws/agentcore-cli --pattern "*.tgz" --dir /tmp/pr-tarball
npm install -g /tmp/pr-tarball/aws-agentcore-0.17.0.tgz

Copy link
Copy Markdown

@agentcore-cli-automation agentcore-cli-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to merge.

Verified:

  • withCommandRunTelemetry wiring in command.tsx is consistent with existing usage in other CLI commands (e.g. validate, import, status).
  • LogsAttrs (has_query, has_level_filter) and LogsEvalsAttrs (has_follow) schemas already exist in schemas/command-run.ts, matching the attributes passed in.
  • ValidationError extends BaseError with defaultSource: 'user', so classifyError will correctly emit source: 'user' and category: 'ValidationError' for the two now-typed conditions in useLogsFlow.
  • CLI path (handleLogs/handleLogsEval) and TUI path (useLogsFlow) are distinct call sites — no double-counting risk.
  • requireProject() remains outside the telemetry wrapper (unchanged behavior, not a regression).

@github-actions github-actions Bot removed the agentcore-harness-reviewing AgentCore Harness review in progress label Jun 3, 2026
@@ -31,7 +32,11 @@ export const registerLogs = (program: Command) => {
requireProject();
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eventually, we'll want this in telemetry, but right now it kills the process on failure, so OOS for here.

@Hweinstock Hweinstock marked this pull request as ready for review June 3, 2026 23:43
@Hweinstock Hweinstock requested a review from a team June 3, 2026 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/xs PR size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants