Repository navigation
fix(install): enrich displayName-lookup log with agentName/instanceId - #424
Merged
Merged
Conversation
Code-reviewer follow-up on PR #412. The two displayName-lookup catch branches in install.ts both log a bare Mongoose error message with no hint about WHICH agent the lookup was attempting. An operator diagnosing 'wrong displayName on reinstall' has to cross-reference timestamps to figure out the install path. Append `${agent.agentName}:${normalizedInstanceId}` to both log lines: - the install-path lookup (line ~284) - the intro-path lookup (line ~420) No behavioral change — strictly diagnostic enrichment. Co-Authored-By: Lily Shen <[email protected]>
…ing-injection
CodeQL flagged the template-literal log lines (`[install] displayName lookup
failed for ${agent.agentName}:${normalizedInstanceId}`) as
format-string-injection: agent.agentName + normalizedInstanceId both
trace back to req.body and end up in the format-string slot.
Same diagnostic payload, just shaped as a structured second arg:
console.warn('[install] displayName lookup failed', {
agent: agent.agentName,
instance: normalizedInstanceId,
error: (lookupErr as Error).message,
});
CodeQL doesn't flag user-tainted values in non-format-string slots.
Co-Authored-By: Lily Shen <[email protected]>
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
Code-reviewer follow-up on PR #412.
Both
console.warnlines in the displayName-lookup catch branches logged a bare Mongoose error message with no hint about WHICH agent the lookup was attempting. An operator diagnosing a 'wrong displayName on reinstall' incident has to cross-reference timestamps to figure out the install path.Now both lines append
${agent.agentName}:${normalizedInstanceId}:No behavioral change — strictly diagnostic enrichment.
Test plan
User.findOnefailure on the install path; verify log line includes the agent identifier🤖 Generated with Claude Code