Skip to content

fix: resolve cert exam when Claude sends module ID#1784

Merged
bokelley merged 5 commits intomainfrom
bokelley/fix-cert-exam-unknown
Apr 1, 2026
Merged

fix: resolve cert exam when Claude sends module ID#1784
bokelley merged 5 commits intomainfrom
bokelley/fix-cert-exam-unknown

Conversation

@bokelley
Copy link
Copy Markdown
Contributor

@bokelley bokelley commented Mar 31, 2026

Summary

  • Accept module IDs (e.g. S1) as attempt_id in complete_certification_exam by resolving to the user's active attempt for that track, with module ID validation guard
  • Include tool input and user display name in Slack error notifications, with sensitive field redaction
  • Add structured warning log when the module ID fallback fires for observability
  • Guard completeModule failure from masking a successful exam completion
  • Pass threadId to createAttempt in start_certification_exam (was undefined)
  • Add sanitization test for Slack formatting characters in display names

Test plan

  • All existing tests pass (126 tests across 4 files)
  • New sanitization test for Slack-special characters in display names
  • TypeScript compiles cleanly
  • Manual: trigger cert exam completion via web chat, verify Slack notification includes tool input and user name

🤖 Generated with Claude Code

… of UUID

Claude sometimes passes the module ID (e.g. "S1") as attempt_id instead
of the attempt UUID, causing a Postgres type error. The tool now detects
non-UUID input and resolves the active attempt via getActiveAttempt.

Also improves error notification debugging: includes tool input
parameters and web user display name in Slack alerts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… of UUID

When Claude sends a module ID (e.g. "S1") as the attempt_id instead of
the actual UUID, the Postgres query fails with "invalid input syntax for
type uuid". Now accepts both formats by detecting non-UUID input and
resolving to the user's active attempt for that track/module.

Also improves error notifications: includes tool input and user display
name in Slack alerts, redacts sensitive fields, adds structured logging
for the fallback path, and guards against completeModule failures
blocking the success response.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bokelley bokelley changed the title fix: resolve cert exam completion when Claude sends module ID fix: resolve cert exam when Claude sends module ID Apr 1, 2026
Main introduced ToolError (expected vs unexpected) while this branch
added toolInput/userDisplayName to notifyToolError. Resolution keeps
both: ToolError distinction for logging + enriched context in Slack
notifications.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Use case-insensitive regex pattern for sensitive key detection instead
  of exact-match Set (catches token, api_key, authorization, etc.)
- Validate track prefix is 1-2 alpha chars before querying DB
- Add log line when active attempt module_id mismatch discards result
- Add ellipsis indicator when tool input JSON is truncated
- Add test for sensitive key redaction

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
capstoneMod is always truthy at this point in the control flow.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bokelley bokelley merged commit ade7020 into main Apr 1, 2026
12 checks passed
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.

1 participant