Skip to content

Enhance context handling, telemetry, and input focus in chat - #4

Merged
kevinliddel merged 6 commits into
mainfrom
feat/more-improvement
Jun 17, 2026
Merged

kevinliddel merged 6 commits into
mainfrom
feat/more-improvement

Conversation

@kevinliddel

Copy link
Copy Markdown
Owner

This pull request introduces several improvements and bug fixes across the chat session, image generation, and UI components. Notably, it enhances context management for chat history, improves user experience in the chat view, optimizes image generation for lower-memory devices, and cleans up the codebase by moving topic suggestion logic to a dedicated file.

Chat context management and reply length:

  • The reply length is now dynamically clamped to the available context window, preventing overflows that could previously occur when the prompt and reply together exceeded the model's context size. This ensures more stable and contextually aware responses.
  • When budgeting tokens for chat history, only a portion (up to 40%) of the context window is reserved for the reply, rather than the full maximum reply length. This change helps preserve more conversation history and prevents losing context in follow-up messages.

User experience improvements in chat UI:

  • The chat input bar's focus state is now managed by the parent ChatView, allowing the keyboard to open automatically when a reply finishes. This streamlines the user experience for sending consecutive messages. [1] [2] [3] [4]
  • The chat view now automatically scrolls to follow streaming assistant replies and re-focuses the input bar after a reply is complete, making the conversation flow smoother and more intuitive. [1] [2]

Image generation optimizations and logging:

  • For devices with less than 5 GB RAM (e.g., iPhone 11), the default context size is increased from 1024 to 2048 tokens, and diffusion steps are reduced from 16 to 8, halving image generation time for a better balance of performance and quality. [1] [2] [3]
  • Image generation now logs both model load and generation times, providing clearer diagnostics and performance insights. [1] [2] [3]

Codebase organization and cleanup:

  • The topic suggestion feature for the Home screen has been moved from ChatSession.swift to a new extension file, keeping the main chat logic focused and maintainable. [1] [2]

Bug fixes and minor improvements:

  • When generating an image, the assistant's message now includes a caption, ensuring follow-up messages are handled coherently.
  • The prefill_text function in the engine now decodes tokens in batches to avoid assertion failures with long histories, improving stability.

These changes collectively improve the reliability, performance, and user experience of the chat and image generation features.

@coderabbitai

coderabbitai Bot commented Jun 17, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@kevinliddel, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 27 minutes and 14 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 63c34494-3848-498e-b55f-eaa2ef53e082

📥 Commits

Reviewing files that changed from the base of the PR and between 55042a4 and 6a87ff7.

📒 Files selected for processing (12)
  • SynapLink.xcodeproj/project.pbxproj
  • SynapLink/Core/Engine/synap_engine.cpp
  • SynapLink/Data/DataSources/Audio/SpeechReader.swift
  • SynapLink/Data/DataSources/Inference/ChatSession+Topics.swift
  • SynapLink/Data/DataSources/Inference/ChatSession.swift
  • SynapLink/Data/DataSources/Inference/ImageGenerator.swift
  • SynapLink/Data/DataSources/Inference/RuntimeProfile.swift
  • SynapLink/Presentation/Components/ChatInputBar.swift
  • SynapLink/Presentation/Components/ImageViewer.swift
  • SynapLink/Presentation/Components/MarkdownText.swift
  • SynapLink/Presentation/Components/MessageBubble.swift
  • SynapLink/Presentation/Views/Chat/ChatView.swift
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/more-improvement

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 and usage tips.

@kevinliddel
kevinliddel merged commit 1cfe2bb into main Jun 17, 2026
5 checks passed
@kevinliddel
kevinliddel deleted the feat/more-improvement branch June 17, 2026 13:22
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