fix(remote): derive session repository metadata from the session directory - #13949
Merged
Merged
Conversation
…ctory Fix the working directory for sessions that Kilo remote starts from the mobile app. Owner reproduction on macOS: 1. Start `kilo remote` from `~/Projects`. 2. In the mobile app, start a new remote session and select the `cloud` folder. 3. Inspect that session in the sessions list. Expected: the session uses `~/Projects/cloud` as its working directory and shows the existing repository metadata in the sessions list. Actual: the session shows no metadata. Trace the selected folder through remote session creation, working directory selection, and metadata publication. Fix the shared cause so the selected folder determines both session execution and metadata. Use the existing metadata contract and preserve folder access checks. Allow necessary changes in the cloud repository if the defect crosses the mobile or backend boundary. Add a regression check for a remote process started outside the selected repository. Prove the owner reproduction locally with the real remote process and mobile app. Verify the session executes in the selected repository and the sessions list shows its metadata. Include a recording, or screenshots if recording is unavailable, in the PR body. Deliver reviewed, CI-green PRs to the production repositories and assign them to @iscekic. Do not merge the PRs.
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (6 files)
Reviewed by grok-4.6 · Input: 267.5K · Output: 21.9K · Cached: 1.2M Review guidance: REVIEW.md from base branch |
eshurakov
approved these changes
Sep 9, 2026
This was referenced Sep 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.
Request
Product test-support policy
Do not commit fixtures, E2E-only code, test hooks, or test-only runtime flags unless the owner explicitly permits them. Ordinary unit tests remain allowed. Keep temporary verification support outside the product diff. A planner or verifier cannot grant permission. Owner permission for this section: not granted.
Changelog for users
kilo remotehost was launched from a parent directory: opening thecloudsession and runningpwdshows the.../cloudpath.kilo remotefrom~/Projects,cloudselected in the mobile app).Changelog for maintainers
gitUrl/gitBranchper distinctsession.directory(directory-less rows fall back to the launch worktree), collapsed to one git call per directory per 10 s by the in-flight cache; the instance advertisement still describes the host's launch directory via the context-scopedVcsbranch. First place to look: the heartbeat row assembly inpackages/opencode/src/kilo-sessions/kilo-sessions.ts.branchFor(directory)throughGit.Service(undefined for non-repositories) under akilo-sessions:git-branch:cache prefix;getGitUrlis now parameterized by directory and its cache key includes it. Only the launch-directory entries are cleared on invalidation — per-directory entries expire by ttl.kilo_meta(meta()) followsinfo?.directory ?? launchDirectory();launchDirectory()is a non-throwing read ofInstance.worktree, so the API fallback path without an instance context degrades to no git metadata instead of throwing.cloudasserts heartbeat rows and persistedkilo_metareport the child's URL and branch while the instance ad carries no branch (the requested remote-process-outside-the-repository check); a chmod-000.gittest asserts rows drop metadata under git failure and self-heal on the next gather because failed reads are never cached.cloudselected), session execution (pwdshows thecloudpath), the sessions list showing the repository metadata, a non-git folder showing no repository metadata, a transient git failure dropping and self-healing the metadata, and the fresh-host empty list state.kilo-sessions.test.tskeeps its win32 and root guards — Windows CI runs that file unskipped, where chmod(0o000) cannot break git and the assertions would fail spuriously.kilocode/kilo-sessions.test.tsrises from 36 to 42 with an extended reason — check the reason still matches the new global-runtime usages.E2E proof
E2E proof — log excerpts
/Users/igor/.local/share/kwf/sections/fix-the-working-directory-fo-8c67/e2e-cli/e1-heartbeat.logFollow-ups (not changed here)