feat(code-review): append team-authored custom message to error comments - #1548
Merged
Conversation
…nt (#1452) Adds an optional, team-authored message that is appended below Kody's default error comment when a PR review fails. Content is the switch: a non-empty message posts, empty falls back to the default-only comment. Author line breaks are preserved as Markdown hard breaks (WYSIWYG). - Error message tab shows the default error comment sample so authors can craft a valid append; drops the On/Off toggle and @variable dropdown for the error message (content is the switch). - Runtime append + line-break preservation in commentManager; stage resolves errorReviewMessage.content on a failed review only. - Config plumbing (interface/entity/mongoose/DTOs/centralized-config/ default-kodus-config) carries errorReviewMessage as {content, status}. - Tests: stage forwarding, comment-manager append + hard breaks, upsert DTO validation, centralized-config, web dirty-state. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…trol markers The inline sanitizer escaped only `-`, `/` and `@` (none special outside a character class) while leaving real metacharacters (`.`, `*`, `(`, …) unescaped — CodeQL js/incomplete-sanitization. Extracts `escapeRegExp` and `stripControlMarkers` (case-insensitive, all occurrences, metachar-safe) and covers them with tests. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…-error-message-1452
|
This PR was not deployed automatically as @Wellington01 does not have access to the Railway project. In order to get automatic PR deploys, please add @Wellington01 to your workspace on Railway. |
Contributor
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
Preview Environment
|
Fanduzi
pushed a commit
to Fanduzi/kodus-ai
that referenced
this pull request
Jul 18, 2026
Production hands every stage after the first a DEEP-FROZEN context: BasePipelineStage.updateContext runs `produce(context, updater)` and Immer auto-freezes the result. Stage specs built plain objects, so a direct write — `context.heavy = x`, `pullRequest.heavy = x`, `context.errors.push(e)` — passed in CI and threw in production. That blind spot shipped three incidents: kodustech#1522 (context.heavy in agent-review, ~27h of reviews finishing with 0 suggestions), c886e36 (pullRequest.heavy in create-file-comments, same class, found only after the first fix shipped), and kodustech#1548 (finish-comments' catch pushing to context.errors — the error handler itself throwing, which replaced the real error with a frozen-mutation one). Each fix added ONE frozen test next to N unfrozen ones, so the next instance had the same escape hatch. frozenContext() runs the fixture through the same produce() the executor uses, and the builders call it — so freezing is the default and the next instance fails in CI with nothing to remember. Four tests mutated the context after building it (ctx.errors = […], ctx.lineComments = […], context.repository.id = …, pullRequest.user = …). None was a product bug: they were asserting against a shape production never hands a stage. Converted to build-time overrides. Scope, honestly: this covers the six specs that EXECUTE a stage. agent-review — where the family started — is untouched, because its only spec tests two pure functions and never runs the stage. Verified: injecting kodustech#1522's exact mutation there still passes. That gap needs a spec, not a freeze. Co-Authored-By: Claude Opus 4.8 (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.
No description provided.