Skip to content

feat(code-review): append team-authored custom message to error comments - #1548

Merged
Wellington01 merged 5 commits into
mainfrom
feat/custom-error-message-1452
Jul 14, 2026
Merged

feat(code-review): append team-authored custom message to error comments#1548
Wellington01 merged 5 commits into
mainfrom
feat/custom-error-message-1452

Conversation

@Wellington01

Copy link
Copy Markdown
Member

No description provided.

Wellington01 and others added 5 commits July 14, 2026 14:14
…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>
@railway-app

railway-app Bot commented Jul 14, 2026

Copy link
Copy Markdown

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.

@kody-ai

kody-ai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Code Review Completed! 🔥

The code review was successfully completed based on your current configurations.

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the `@kody start-review` command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug
Performance
Security
Business Logic

Access your configuration settings here.

@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown

Preview Environment

Preview environments have been cleaned up.

@Wellington01 Wellington01 changed the title Feat/custom error message 1452 feat(code-review): append team-authored custom message to error comments Jul 14, 2026
@Wellington01
Wellington01 merged commit 7d91c5b into main Jul 14, 2026
29 of 31 checks passed
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>
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