Repository navigation
fix(native-chat): split the attachment failure words out so Lint passes on main - #26079
Conversation
…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.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe change adds Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to 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)
✨ Finishing Touches📝 Generate docstrings
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. Comment |
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
src/renderer/src/components/native-chat/agent-session-failure-words-text.tsholds 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.attachmentEmpty…attachmentUnreadable) move unchanged to a newagent-session-failure-attachment-words-text.tsand are spread back into the same table. The main file drops to 260 counted lines.Why
Record<AgentSessionFailureCopyId, …>type, so the compiler still errors if any failure id has no wording. The new module usessatisfies, so the moved functions keep their parameter types.removeUnusedKeys: trueand only sees literal keys, so generated keys would be invisible to it and the next catalog sync would delete them fromen.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
Exact-head CI run 37576921066 on
54784e60c649passed 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.jsonon main's file reportsmax-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.tspasses (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
docs/reference/agent-skill-sharing-upstream-boundary.mdand 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
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)