Repository navigation
Conversation
This branch has not been deployed
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.
Summary
When a local directory is bound to a Space via
cohub runtime up, running Space-scoped CLI commands orcohub runtime status/down/logs/detach/importfrom a subdirectory of that repository currently misses the binding becausegetRuntimeSpaceBinding()only checks exactbinding.root === cwd.In particular,
cohub promptsilently fell back to the user's personalHomeSpace when invoked from a subdirectory, while other commands exited withNo target space.Changes
packages/cli/src/runtime/space-binding.ts:findRuntimeSpaceBinding()/getRuntimeSpaceBinding()exact-match socohub runtime upcontinues binding the exact requested directory without hijacking a parent binding.findContainingRuntimeSpaceBinding()andfindNearestRuntimeSpaceBinding(), walking ancestor directories viadirname(like Git):/work/app-2) never falsely match/work/app.packages/cli/src/space.ts,packages/cli/src/runtime/launch.ts,packages/cli/src/commands/runtime.ts:resolveBoundSpace(),resolveRuntimeTarget(), andboundRuntime()tofindNearestRuntimeSpaceBinding(), returningbinding.rootas the workspace root forruntime detachandruntime import.packages/cli/tests/runtime-space-binding.test.ts:Verification
pnpm --filter @neta-art/cohub-cli typecheck&build— passedpnpm exec biome checkon all 5 touched files — 0 errorsnode --import tsx --test packages/cli/tests/runtime-space-binding.test.ts packages/cli/tests/space.test.ts packages/cli/tests/desktop.test.ts— 24/24 passed