Skip to content

fix: clarify mark-read target types#88

Merged
shaypal5 merged 1 commit into
mainfrom
codex/fix-mark-read-target-aliases
May 31, 2026
Merged

fix: clarify mark-read target types#88
shaypal5 merged 1 commit into
mainfrom
codex/fix-mark-read-target-aliases

Conversation

@shaypal5
Copy link
Copy Markdown
Contributor

Summary

  • Accept documented and intuitive mark-read target aliases, including dm, direct-message, and direct-conversation for conversation.
  • Return actionable API validation details with valid target types and accepted aliases.
  • Update CLI help, API docs, quickstart docs, and schema metadata so callers do not have to inspect source.
  • Add API and CLI regression tests for alias normalization and invalid target-type errors.

Self-review fixes applied

Self-review prompt used: "Review the PR yourself, and take an outsider's view: Pretend you're a senior dev and you really don't like the way this PR is implemented; be brutally honest, and aim to make this PR much better with you feedback."

Finding: the initial CLI implementation normalized mark-read target type inside the request payload, after resolving the agent id. That meant a pure local usage error could still require API/token setup before reporting the invalid target type.

Recommended action/fix: normalize and validate the target type before resolveAgentId(...) or any API request. Add a focused CLI test that runs with no API environment and expects the actionable invalid-target response.

Applied: mark-read now computes targetType before agent resolution, and tests/cli.test.ts covers the no-API-env invalid target path.

Validation

  • npm test -- --run tests/api-auth.test.ts tests/cli.test.ts
  • npm test
  • npm run check
  • git diff --check
  • npm run build

Closes #84

@shaypal5 shaypal5 added the bug Something isn't working label May 31, 2026
@shaypal5 shaypal5 merged commit b217dd6 into main May 31, 2026
1 check passed
@shaypal5 shaypal5 deleted the codex/fix-mark-read-target-aliases branch May 31, 2026 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mark-read should accept documented target aliases or report valid target types

1 participant