feat(mobile): compress cloud command output with rtk (port #3257)#3339
Merged
Conversation
Adds a "Compress command output" cloud setting to the mobile app, on by default. When enabled, eligible shell command output on cloud runs is routed through rtk so verbose output is compressed before it reaches the model, reducing token usage. Only the Cloud half of #3257 is ported: mobile has no local agent sessions, no workspace-server, and no rtk binary, so the desktop Local checkbox, the agent.rtkStatus query, and the "rtk binary not found" warning have no mobile equivalent. The preference persists as rtkEnabledCloud (default true) and threads into every cloud-run start/resume path. Following the server default (enabled), only an explicit opt-out sends rtk_enabled: false; the enabled case sends nothing. Generated-By: PostHog Code Task-Id: eeb20b54-b0ff-4624-b0df-64ce78edbe50
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
Contributor
|
Reviews (1): Last reviewed commit: "feat(mobile): compress cloud command out..." | Re-trigger Greptile |
The session-store resume path built a new cloud run with resumeFromRunId but no rtkEnabled. Since rtkEnabled only alters the wire payload when false, a user who disabled compression had it silently re-enabled after an inactive-session resume. Forward the current preference so the opt-out survives resume, matching the other cloud-run call sites. Generated-By: PostHog Code Task-Id: 3b8a4908-02e4-4350-80ad-c247be2aa546
Generated-By: PostHog Code Task-Id: 3b8a4908-02e4-4350-80ad-c247be2aa546
estefaniarabadan
approved these changes
Jul 10, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
Cloud runs on desktop can compress verbose shell command output through
rtkbefore it reaches the model, cutting token usage — added in #3257. The mobile app had no equivalent, so cloud runs started from mobile always sent uncompressed output.Why: bring the mobile app to parity so cloud runs started from a phone benefit from the same token savings, on by default.
Changes
Ports only the Cloud half of #3257 to
apps/mobile. Mobile has no local agent sessions, no workspace-server, and nortkbinary, so the desktop Local checkbox, theagent.rtkStatusquery, and the "rtk binary not found" warning have no mobile equivalent and are intentionally not ported.rtkEnabledCloud(persisted, defaults true) plus its setter inpreferencesStore, mirroringautoPublishCloudRuns.Switchrow under General.rtkEnabled?option onrunTaskInCloud. Mirroring the server default (enabled), only an explicit opt-out sendsrtk_enabled: false; the enabled case sends nothing.No desktop or shared-package code is touched — this PR is
apps/mobileonly.How did you test this?
pnpm --filter mobile test— 402 tests pass, including newapi.test.tscases covering the payload builder (rtk_enabledabsent when the preference is on, present andfalsewhen off).tsc --noEmiton the mobile project — no new type errors in the changed files.biome checkon the changed files — clean.Automatic notifications
Created with PostHog Code