Skip to content

feat(chat): tailor replies for mobile and text-to-speech - #429

Merged
chriswritescode-dev merged 2 commits into
mainfrom
feature/mobile-friendly-replies
Oct 15, 2026
Merged

chriswritescode-dev merged 2 commits into
mainfrom
feature/mobile-friendly-replies

Conversation

@chriswritescode-dev

@chriswritescode-dev chriswritescode-dev commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Tag Manager prompts as mobile or desktop using the shared viewport check.
  • Add brief, conversational, TTS-friendly system instructions to model requests for mobile sessions.
  • Clear mobile mode after a desktop prompt; preserve it when client metadata is absent.
  • Add frontend metadata and backend session-hook tests.

Validation

  • Backend plugin suite: 34 tests passed.
  • Frontend API suite: 44 tests passed.
  • pnpm lint: passed with 41 warnings in unchanged backend/src/routes/repos.test.ts.
  • git diff --check: passed.

Summary by CodeRabbit

  • New Features
    • Prompts now identify whether they come from a mobile or desktop viewport, allowing responses to be tailored to the device.
    • Mobile sessions receive response guidance adapted for mobile. Desktop prompts switch the session back to desktop response guidance.

@coderabbitai

coderabbitai Bot commented Oct 14, 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: Essentials
  • Run ID: 18eae6ae-15cc-47c2-b8c0-0e72be4c235f
📥 Commits

Reviewing files that changed from the base of the PR and between b974618 and f80aa1c.

📒 Files selected for processing: 5
  • backend/src/services/opencode-manager-tool-plugin.ts
  • backend/test/helpers/opencode-plugin-context.ts
  • backend/test/services/opencode-manager-tool-plugin.test.ts
  • frontend/src/api/opencode.ts
  • frontend/src/hooks/useMobile.ts
🚧 Files skipped from review as they are similar to previous changes: 5
  • frontend/src/api/opencode.ts
  • frontend/src/hooks/useMobile.ts
  • backend/src/services/opencode-manager-tool-plugin.ts
  • backend/test/services/opencode-manager-tool-plugin.test.ts
  • backend/test/helpers/opencode-plugin-context.ts

Included review availability: This review used your included allowance. 4 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.

📝 Walkthrough

Prompt requests identify whether they come from a mobile or desktop viewport. The manager plugin tracks that designation per session and adds mobile response-style instructions to context events for tracked mobile sessions. Tests cover metadata selection, session tracking, and context behavior.

Changes: Mobile Prompt Context

Layer / File(s) Summary
Client metadata and prompt requests
shared/src/schemas/internal-assistant.ts, frontend/src/hooks/useMobile.ts, frontend/src/api/opencode.ts, frontend/src/api/opencode.test.ts
The shared schema defines the prompt-client metadata key and supported values. The frontend detects mobile viewports and includes the corresponding client value in prompt requests. Tests cover mobile and desktop metadata.
Session tracking and context instructions
backend/src/services/opencode-manager-tool-plugin.ts, backend/test/helpers/opencode-plugin-context.ts, backend/test/services/opencode-manager-tool-plugin.test.ts
The plugin tracks mobile and desktop prompt events and appends mobile instructions to context events for tracked mobile sessions. The test context supports prompt and context hooks, and tests cover session tracking and instruction behavior.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant sendPrompt
  participant isMobileViewport
  participant ManagerPlugin
  sendPrompt->>isMobileViewport: Check viewport width
  isMobileViewport-->>sendPrompt: Return mobile or desktop
  sendPrompt->>ManagerPlugin: Send prompt with client metadata
  ManagerPlugin->>ManagerPlugin: Track client type on prompt event
  ManagerPlugin->>ManagerPlugin: Add mobile instructions to tracked session context
Loading
Merge Risk: ⚪ Minimal · up to f80aa

Mobile prompts carry the intended metadata, and the plugin applies mobile guidance to tracked sessions. No actionable merge blocker was identified.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 63.64% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 7 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly summarizes the main changes: mobile-specific chat replies and text-to-speech-friendly output.
Description check Passed The description includes a clear summary and validation results. It omits the template's Type of Change and Checklist sections, but the description remains mostly complete and relevant.
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

🤖 Completed: Fix pre-merge checks in PR #429 — View commit f80aa1c

@coderabbitai

coderabbitai Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Add Carrot credits or activate Agent usage billing to use Autofix

@chriswritescode-dev
chriswritescode-dev merged commit ccdf75d into main Oct 15, 2026
2 checks passed
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