Skip to content

fix(native-chat): split the attachment failure words out so Lint passes on main - #26079

Merged
nwparker merged 1 commit into
mainfrom
brennanb2025/main-failure-words-max-lines
Oct 7, 2026
Merged

nwparker merged 1 commit into
mainfrom
brennanb2025/main-failure-words-max-lines

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 0 0 0 0
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​58 $\color{#cf222e}{\Huge{\mathbf{−}}}$​46 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​12

ELI5

Main's Lint step is failing because one native-chat file went over the 300-line limit. This moves the twelve attachment error messages into their own small file. Nothing the user sees changes.

What Changed

  • Problem: src/renderer/src/components/native-chat/agent-session-failure-words-text.ts holds the translated wording for every chat failure message. Claude account profiles: dormant routing and consumers (Step 2 of 4) #24351 brought it close to the limit, and feat(native-chat): Grok as a structured chat over the Agent Client Protocol #25225 added one more message (sessionNotRestored, +6 lines), taking it to 304 counted lines. max-lines (300) now fails Lint on main. Because Lint fails first, every PR's "static analysis and typecheck" job stops there and never runs typecheck, so CI isn't checking types on any open PR.
  • Change: the twelve attachment-refusal entries (attachmentEmpty … attachmentUnreadable) move unchanged to a new agent-session-failure-attachment-words-text.ts and are spread back into the same table. The main file drops to 260 counted lines.
  • User-facing: none. Same translation keys, same English fallbacks, same lookup.

Why

  • Attachment refusals are a self-contained group, so the split follows a real boundary instead of an arbitrary line count.
  • The table keeps its full Record<AgentSessionFailureCopyId, …> type, so the compiler still errors if any failure id has no wording. The new module uses satisfies, so the moved functions keep their parameter types.
  • Alternative rejected: building every entry from its id (all entries share the same shape). Translation-key extraction runs with removeUnusedKeys: true and only sees literal keys, so generated keys would be invisible to it and the next catalog sync would delete them from en.json. No renderer code builds translation keys from templates today.

Linked Issue

None. This fixes a red Lint step on main.

Visual Proof

N/A: a pure file move with no rendering or behavior change.

Testing

Measurement Before After
Main wording file, nonblank/noncomment lines counted by lint 304 (limit 300) 260
Line-limit errors 1; static checks stop 0; lint and typecheck pass
Attachment entries, literal translation keys, English fallbacks and interpolation 12 original entries All 12 preserved exactly; existing 11 tests pass

Exact-head CI run 37576921066 on 54784e60c649 passed all five full unit shards, static checks/typecheck, packaging, relay and the aggregate/selection gates. CodeRabbit reviewed this head with no actionable findings or unresolved threads. The five actual reports contain all 11,404 selected files exactly once: 11,269 pass, 135 existing skips, zero failures or unhandled errors. This restores CI qualification; it makes no test-speed claim.

  • oxlint -c .oxlintrc.json on main's file reports max-lines: File has too many lines (304). With this change, both files lint clean.

  • vitest run src/renderer/src/components/native-chat/agent-session-failure-words-text.test.ts passes (11 tests).

  • A typecheck of the two files and their test reports no errors in them.

  • Formatted with oxfmt.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below (existing tests cover the table; this moves it unchanged)

AI Disclosure

Review

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Renderer-only file move. No platform, SSH, mobile, or wire impact.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

…le so lint passes on main

The failure-words table grew past the 300-line limit when two changes landed back to back,
which fails Lint on main and makes every PR's static-analysis job skip typecheck.
@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4f279910-75e7-45a6-94ef-ba086235be58
📥 Commits

Reviewing files that changed from the base of the PR and between 64bb937 and 54784e6.

📒 Files selected for processing (2)
  • src/renderer/src/components/native-chat/agent-session-failure-attachment-words-text.ts
  • src/renderer/src/components/native-chat/agent-session-failure-words-text.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The change adds ATTACHMENT_FAILURE_PIECES, a mapping of attachment failure identifiers to translated text. The existing failure-word map imports and spreads this mapping alongside its other entries.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 54784

The attachment text extraction preserves the existing lookup behavior, so no material PR-specific merge risk is evident.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the change: splitting attachment failure words into a separate file to fix the lint limit. It is slightly wordy but specific.
Description check ✅ Passed The description explains the problem, change, rationale, user impact, visual proof, and testing. It also addresses the checklist and notes that the issue link is unavailable; the template allows maint…
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

2 participants