You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(items): tip the bot when its Needs you ask is hard to read - #44902
When a bot sets an item to Needs you, it now gets a one-line tip back if its question looks hard to read: choices written into the text instead of as buttons, no actual question, a long question or context, or hashes and IDs. The bot rules also give the limits. The ask is still posted exactly as written.
Files
Added
Deleted
Net
Test
2
$\color{#1a7f37}{\Huge{\mathbf{+}}}$300
0
$\color{#1a7f37}{\Huge{\mathbf{+}}}$300
Prod
6
$\color{#1a7f37}{\Huge{\mathbf{+}}}$312
$\color{#cf222e}{\Huge{\mathbf{−}}}$3
$\color{#1a7f37}{\Huge{\mathbf{+}}}$309
What Changed
Before: bots were told to give choices as --ask/--option buttons, but with no length guidance and no feedback when an ask came out as a wall of text.
After:
The bot rules and orca bot item set --help give the limits:
Each question is one line under 140 characters, ending in "?".
--comment context is at most 5 short lines or a link.
Plain words, not hashes, IDs or review labels; link those instead.
After a Needs-you bots.items.set succeeds, the host checks the bot's own text (src/shared/bots/bot-item-ask-advice.ts). The result gains an optional advice: { codes, tip }, and the CLI prints the tip as a second line, e.g. Posted. Tip: Give the choices as buttons with --ask and --option, not in the text. Set Needs you again if you rewrite it.
What the check looks for, in priority order (only the first one fires as a tip): prose_choices, no_question, long_question (over 140 characters, or a prose ask whose first paragraph is over 300), long_context (over 300 characters or 5 lines), jargon (12+ hex characters, ctx_/task_/msg_ IDs, run-together words).
What the check ignores: text inside closed code spans and fences, closed link targets, URLs and paths. Review labels like D4 or P2 are left to the rule text.
Unchanged: nothing is refused, and the stored text, mail and notifications are the same as before. Plain comments and owner writes are not checked.
67% wrote the choices in prose ("Reply yes, or wait", "A) … B) …").
52% had no question mark.
The median ask was 424 characters.
After it, 6 asks: all 6 used buttons. Their remaining weak spot is a dense context paragraph.
The structure now exists. What was missing was a stated length limit and any feedback to the bot. On that sample, the tip fires on 192 of the 223 old prose asks and on none of the 6 new button asks.
Alternatives rejected:
Refusing hard-to-read asks: a refused write may never be retried.
Lowering the question's character limit: that refuses writes too.
Rewriting asks with a model: it adds cost and delay and can change the meaning.
Computing the tip in the CLI: RPC and --json callers would miss it.
Clamping long questions in the card: the ask card already clamps them, with Show more.
Linked Issue
N/A (maintainer change).
Visual Proof
N/A: no UI change. The only visible output is one extra line in the bot's CLI result.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
bot-item-ask-advice.test.ts (46 tests):
Each code, with fixed inputs.
Clean --ask input and code, links, paths and camelCase names give no tip.
Priority order, and the 8,000-character scan limit.
--ask questions and context are checked the same way as prose: a "?" inside a URL or code does not count, choices written into them are flagged, and each field is masked on its own.
A table of masking cases: unclosed or mismatched backticks, links with no label, nested and adjacent links, and URLs. Text outside a properly closed construct always stays visible.
New cases failed against the earlier versions of the classifier.
bots-items.test.ts: a Needs-you set with prose choices is stored exactly as sent and returns advice; a clean --ask set returns none. This fails with the handler change reverted.
Affected test files pass 84 of 84, and pnpm typecheck and pnpm lint pass locally on macOS. The classifier was also run over the sample above, counting results only.
The design, code and tip wording were reviewed before opening.
Performance
Cost per write: bounded multiple linear passes. The admitted formatted ask is at most 8,000 UTF-16 units, plus at most 2,500 extra prompt units, because each --ask field is masked on its own and each prompt is checked again for its question mark. This runs only on Needs-you set writes, after the write and its side effects have finished. There is no I/O, no state and no model call.
Code, link and URL masking: done by single-pass scanners rather than backtracking regexes.
Measured locally: at commit 08328c8, run over prose comments, time grew linearly with input (ordinary prose: 0.04/0.08/0.15/0.28 ms at 1k/2k/4k/8k characters), and each tested adversarial comment shape (unclosed brackets, link openers, backtick and fence runs, URLs, short tokens) stayed under 1 ms at 8k. The final per-field --ask path was not timed separately.
Risk
Level: Low
Behavior: the write itself is unchanged. The riskiest part is a misleading tip, which bots may act on by re-asking.
Compatibility:advice is optional. Older CLIs ignore it, and newer CLIs talking to older hosts simply get no tip. The serving host computes it, so local, paired and remote hosts behave the same.
Bot rules: the rule text grows by about 60 words. Running chats get it through the existing rules update.
Rollback: a plain revert backs it out.
Agent skill upstream boundary
Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.
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)
I stated the risk: what could break, for whom, and how to back it out
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)
After a Needs you write, the host checks the bot's own ask and returns one
advisory tip: choices written in prose, no question, a long question or context,
or hashes and ids. The ask is stored, mailed and shown exactly as sent. The bot
rules and CLI help now give the limits: one question line under 140 characters,
context in up to 5 short lines or a link.
The URL and link-target masks rescanned to the end of a long word from every
position; they now cut each word once. "reply with a summary" no longer reads
as option A, and ids inside ../, Windows and bracketed or quoted paths no
longer count as jargon.
A link's target is cut but what follows it in the same word stays, so 'Is
[fix](x)?' still has its question and an id after a link is still seen; a URL
keeps its trailing punctuation. 'reply/answer/say' match in any case while the
option letter must be a capital or a digit.
An unclosed link target, backtick or fence now hides nothing, and text before a
URL in the same word stays visible, so a question mark or an id there is still
read. Pinned by a table of mask cases.
Code is hidden only between backtick runs of the same length (a span stays on
one line), and a link target only after a [label] on the same line with a
target free of spaces, brackets and parentheses. Anything else is read as text,
and a backtick no longer hides an id it touches.
No actionable comments were generated in the recent review.
Walkthrough
The change adds botItemAskAdvice to check bot item comments and structured ask fields for specified content patterns and limits. The RPC handler adds advice to qualifying needs_you results. The CLI formatter displays the advice tip when present. Bot guidance and tests are updated to reflect and verify these behaviors.
Merge Risk: Minimal · up to e18d0
Adds optional readability tips when a bot sets an item to Needs you. The ask is still posted unchanged and older clients ignore the tip. No merge-blocking risk is evident.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: when a bot sets an item to Needs you, the host now returns a readability tip if the ask is hard to read. It uses the conventional feat(scope) prefix, is 63 characters,…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description check
The description covers the ELI5, what changed, why, testing, performance, and risk. It describes the advice feature, the limits in the bot rules and help text, and the masking behavior. It also explai…
Full details: Title check
Explanation
The title names the main change: when a bot sets an item to Needs you, the host now returns a readability tip if the ask is hard to read. It uses the conventional feat(scope) prefix, is 63 characters, and is a single sentence. The title is specific enough for a teammate scanning history.
Full details: Description check
Explanation
The description covers the ELI5, what changed, why, testing, performance, and risk. It describes the advice feature, the limits in the bot rules and help text, and the masking behavior. It also explains the rejected alternatives and the rollback plan. The template's Visual Proof section is marked N/A with a reason. The Linked Issue section says N/A (maintainer change), but the template asks for a linked issue for outside contributors, and the Fixes # line is left blank. The Review, Notes, and AI Disclosure sections are not filled in. The Testing checklist also contains an unchecked manual-testing box. The description states that tests cover 46 tests, but the objectives state 43 tests, and the description reports 84 of 84 while the objectives report 76/76. These counts conflict, so the author should reconcile them. The Risk section lists a level and a rollback method, but it does not clearly cover the bot-rules text change in every detail. Overall the description is mostly complete with a few gaps.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Warning
The configuration directory could not be loaded. This review used the available YAML and UI settings; directory instructions and checks were not evaluated.
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.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 72a6fd0a-bbd5-4058-b4e0-30085bd28994
Commits
Reviewing files that changed from the base of the PR and between b433f4e and e18d080.
Files selected for processing: 2
src/shared/bots/bot-item-ask-advice.test.ts
src/shared/bots/bot-item-ask-advice.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.
A question mark inside a URL or code no longer counts as the ask's question, and
choices written into an --ask question or its context get the buttons tip too;
option labels are never checked for it.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 3bb87bea-2740-4181-a222-c63fdf223b61
Commits
Reviewing files that changed from the base of the PR and between b9c7364 and b433f4e.
Files selected for processing: 2
src/shared/bots/bot-item-ask-advice.test.ts
src/shared/bots/bot-item-ask-advice.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
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
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.
ELI5
When a bot sets an item to Needs you, it now gets a one-line tip back if its question looks hard to read: choices written into the text instead of as buttons, no actual question, a long question or context, or hashes and IDs. The bot rules also give the limits. The ask is still posted exactly as written.
What Changed
--ask/--optionbuttons, but with no length guidance and no feedback when an ask came out as a wall of text.orca bot item set --helpgive the limits:--commentcontext is at most 5 short lines or a link.bots.items.setsucceeds, the host checks the bot's own text (src/shared/bots/bot-item-ask-advice.ts). The result gains an optionaladvice: { codes, tip }, and the CLI prints the tip as a second line, e.g.Posted. Tip: Give the choices as buttons with --ask and --option, not in the text. Set Needs you again if you rewrite it.prose_choices,no_question,long_question(over 140 characters, or a prose ask whose first paragraph is over 300),long_context(over 300 characters or 5 lines),jargon(12+ hex characters,ctx_/task_/msg_IDs, run-together words).Why
A sample of 229 Needs-you asks from three days:
--askreached the app (feat(items): show waiting questions as cards on the item page #44262), 223 asks:--ask.The structure now exists. What was missing was a stated length limit and any feedback to the bot. On that sample, the tip fires on 192 of the 223 old prose asks and on none of the 6 new button asks.
Alternatives rejected:
--jsoncallers would miss it.Linked Issue
N/A (maintainer change).
Visual Proof
N/A: no UI change. The only visible output is one extra line in the bot's CLI result.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
bot-item-ask-advice.test.ts(46 tests):--askinput and code, links, paths and camelCase names give no tip.--askquestions and context are checked the same way as prose: a "?" inside a URL or code does not count, choices written into them are flagged, and each field is masked on its own.bots-items.test.ts: a Needs-you set with prose choices is stored exactly as sent and returnsadvice; a clean--askset returns none. This fails with the handler change reverted.Affected test files pass 84 of 84, and
pnpm typecheckandpnpm lintpass locally on macOS. The classifier was also run over the sample above, counting results only.The design, code and tip wording were reviewed before opening.
Performance
--askfield is masked on its own and each prompt is checked again for its question mark. This runs only on Needs-yousetwrites, after the write and its side effects have finished. There is no I/O, no state and no model call.--askpath was not timed separately.Risk
Level: Low
adviceis optional. Older CLIs ignore it, and newer CLIs talking to older hosts simply get no tip. The serving host computes it, so local, paired and remote hosts behave the same.Agent skill upstream boundary
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)