fix: resolve cert exam when Claude sends module ID#1784
Merged
Conversation
… 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>
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
S1) asattempt_idincomplete_certification_examby resolving to the user's active attempt for that track, with module ID validation guardcompleteModulefailure from masking a successful exam completionthreadIdtocreateAttemptinstart_certification_exam(wasundefined)Test plan
🤖 Generated with Claude Code