Skip to content

fix(cli): share project-id truncation helper#83

Closed
barry166 wants to merge 1 commit into
agentctxhq:mainfrom
barry166:codex/issue-79-projectid-display
Closed

fix(cli): share project-id truncation helper#83
barry166 wants to merge 1 commit into
agentctxhq:mainfrom
barry166:codex/issue-79-projectid-display

Conversation

@barry166

Copy link
Copy Markdown
Contributor

Summary

  • extract a shared shortProjectId helper and display-length constant
  • switch both status and reset to reuse that helper
  • extend the existing namespace test file with coverage for the shared formatting helper

Closes #79

Testing

  • npm run typecheck --workspace @agentctxhq/agentctx
  • npm run build --workspace @agentctxhq/agentctx
  • npx biome check packages/agentctx/src/storage/namespace.ts packages/agentctx/src/cli/status.ts packages/agentctx/src/cli/reset.ts packages/agentctx/test/storage/namespace.test.ts
  • npx vitest run test/storage/namespace.test.ts

Disclosure

  • AI-assisted: Yes
  • Human reviewed: Yes

status and reset both rendered the same shortened project id with separate\nmagic numbers. Centralizing the display helper keeps the output stable\nwhile giving future display-length changes one place to land.\n\nConstraint: Output format must stay first-12-chars plus ellipsis\nRejected: Leave duplicate slice literals in place | easy to drift on the next display tweak\nConfidence: high\nScope-risk: narrow\nReversibility: clean\nDirective: Reuse shortProjectId for any future user-facing project-id truncation\nTested: npm run typecheck --workspace @agentctxhq/agentctx\nTested: npm run build --workspace @agentctxhq/agentctx\nTested: npx biome check packages/agentctx/src/storage/namespace.ts packages/agentctx/src/cli/status.ts packages/agentctx/src/cli/reset.ts packages/agentctx/test/storage/namespace.test.ts\nTested: npx vitest run test/storage/namespace.test.ts\nNot-tested: Full workspace test suite
@barry166

Copy link
Copy Markdown
Contributor Author

Closing this stale PR to keep my open PR queue focused.

@barry166 barry166 closed this Jun 28, 2026
@barry166 barry166 deleted the codex/issue-79-projectid-display branch June 28, 2026 14:45
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.

Project-id display truncation projectId.slice(0, 12) is duplicated as a magic number in status and reset

1 participant