Skip to content

fix(web): treat skills as text in question answers - #7812

Closed
patriksimms wants to merge 1 commit into
pingdotgg:mainfrom
patriksimms:fix/question-answer-skill-syntax
Closed

fix(web): treat skills as text in question answers#7812
patriksimms wants to merge 1 commit into
pingdotgg:mainfrom
patriksimms:fix/question-answer-skill-syntax

Conversation

@patriksimms

@patriksimms patriksimms commented Aug 21, 2026

Copy link
Copy Markdown

Closes #7805

Pending question answers used the regular composer skill UI even though the response path only sends answer strings. Selecting or completing a $skill token could leave the picker open and desynchronize Lexical cursor state.

This disables skill suggestions, slash-menu skill entries, and inline skill tokens while a pending question is active. File mentions and slash commands keep their existing behavior. The regular composer still supports skills.

Tests:

  • 81 focused web tests
  • Web typecheck
  • Targeted lint and formatting checks

Evidence:

Implemented with OpenAI gpt-5.6-sol using Codex in T3 Code.

Note

Treat $skill syntax as plain text when pending progress exists

  • Introduces an includeSkillTokens flag that is threaded through the prompt editor, cursor logic, and trigger detection utilities.
  • In ChatComposer.tsx, sets the flag based on activePendingProgress === null, disabling skill token parsing while a pending progress item exists.
  • When the flag is false, $skill syntax is treated as plain text: skill triggers and menu items are excluded, and segment splitting in composer-editor-mentions.ts drops skill matches. Path and slash commands remain unaffected.
  • Behavioral Change: Arrow key navigation, selection wrapping, and cursor adjacency checks in composer-logic.ts now skip $skill tokens only when includeSkillTokens is true.
📊 Macroscope summarized 5568f19. 4 files reviewed, 1 issue evaluated, 0 issues filtered, 1 comment posted

🗂️ Filtered Issues

Summary:
- Disable skill suggestions and inline skill tokens for pending questions.
- Keep cursor and trigger state aligned when pending input starts or ends.

Rationale:
- Question responses send answer strings, not provider turns. Rendering skill
  tokens there could desynchronize Lexical cursor state and recurse updates.

Tests:
- vp test run on five focused web test files (81 tests)
- vp run --filter @t3tools/web typecheck
- targeted vp lint and vp fmt --check

Refs pingdotgg#7805

AI-Assisted: true
AI-Agent: codex
AI-Model: openai/gpt-5.6-sol
@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3a0e7c1a-a4a9-47c8-9727-5245131e8baa

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Aug 21, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium

When includeSkillTokens changes, the dead-key backtick handler still uses the value captured by the previous effect, so collapseExpandedComposerCursor computes replacementStart with the wrong tokenization mode and replaces/selects the wrong range after a $skill. Include props.includeSkillTokens in the listener effect dependencies (or read it through a ref/effect event) so the handler uses the current mode.

🤖 Copy this AI Prompt to have your agent fix this:
In file @apps/web/src/components/ComposerPromptEditor.tsx around line 1548:

When `includeSkillTokens` changes, the dead-key backtick handler still uses the value captured by the previous effect, so `collapseExpandedComposerCursor` computes `replacementStart` with the wrong tokenization mode and replaces/selects the wrong range after a `$skill`. Include `props.includeSkillTokens` in the listener effect dependencies (or read it through a ref/effect event) so the handler uses the current mode.

@patriksimms

Copy link
Copy Markdown
Author

Closing in favor of #7818, which fixes the same issue (#7805) by treating question answers as plain text end to end (matching mobile) instead of threading an includeSkillTokens flag through the shared cursor and tokenizer logic. Smaller surface, and it removes the trigger-menu bug class in answers structurally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: Dollar Skill invocation in question tool UI glitches out

1 participant