fix: address remaining code review issues from PR #39
Merged
AN
8mo ago+86+86+01234567890123456789-29-29-01234567890123456789
Summary
Addresses all remaining issues from the comprehensive code review on PR #39. PR #40 fixed some issues; this PR covers the rest.
Critical (1)
- Issue #2: MCP
listPrompts()/listResources()now wrapped inwithTimeout()— prevents CLI hang when MCP server stalls
Major (3)
- Issue #5: MCP tool type detection — added
MCP.isMcpTool()with a maintained Set, replacing brokenstartsWith("mcp__")prefix check that caused all MCP tools to be tracked as "standard" - Issue #6: MCP prompt template getter — replaced
new Promise(async ...)anti-pattern with.then()chain; now throws on undefined template instead of silently returning blank - Issue #7:
Truncate.cleanup()— wrappedIdentifier.timestamp()per-entry in try/catch so a single malformed filename no longer aborts entire cleanup
Minor (8)
- Issue #8: Empty
session_idin early events — fallback to"startup"instead of empty string - Issue #9:
session_endon early termination — addedprocess.once("beforeExit")handler - Issue #10:
compactionAttemptsunbounded growth — delete session entry on completion/error - Issue #11:
ai.cloud.roletag — changed from"altimate-code"to"altimate" - Issue #12: Error truncation — standardized on
.message(not.toString()) to avoid leaking stack traces - Issue #13:
skill_count— populated fromSkill.all()instead of hardcoded0 - Issue #14: Context utilization — removed
cache_writefrom token count (not part of context window consumption) - Issue #15: Buffer overflow — added dropped events counter, logged on next flush
Docs
- Fixed incorrect config path in telemetry docs (
~/.config/altimate/config.json→~/.config/altimate-code/altimate-code.json) - Added missing
telemetryfield to config schema table in config docs
Already fixed in PR #40 (verified)
- Issue #1 (PII): email already SHA-256 hashed
- Issue #3 (env var opt-out):
ALTIMATE_TELEMETRY_DISABLEDalready implemented - Issue #4 (MCP disconnect transport): already reads from stored state
Test plan
- All 103 existing tests pass (
bun teston telemetry, command-resilience, truncation, compaction) - No new TypeScript errors introduced (2 pre-existing errors remain)
- Manual: verify MCP tool calls are tracked as
"mcp"type (not"standard") - Manual: verify
listPrompts()/listResources()timeout after 30s on unresponsive server - Manual: verify
session_endfires on Ctrl+C
🤖 Generated with Claude Code