Skip to content

Make workdir consistent with the sidecar structure.#359

Open
michael-webster wants to merge 1 commit into
mainfrom
webster/standardize-work-dir
Open

Make workdir consistent with the sidecar structure.#359
michael-webster wants to merge 1 commit into
mainfrom
webster/standardize-work-dir

Conversation

@michael-webster
Copy link
Copy Markdown
Contributor

Chunk sidecars use /home/user as the home dir, this makes the command logic reference that known location instead of relative paths.

Chunk sidecars use /home/user as the home dir, this makes the command
logic reference that known location instead of relative paths.
@michael-webster michael-webster marked this pull request as ready for review May 22, 2026 23:53
Comment thread internal/sidecar/sync.go
)

const workspaceDir = "./workspace"
const workspaceDir = "/home/user"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If repo is empty, ResolveWorkspace returns bare /home/user. The retry path at line 92 runs rm -rf on whatever ResolveWorkspace returned — previously that would have been rm -rf ./workspace (contained), now it's rm -rf /home/user (wipes the sidecar home dir). DetectOrgAndRepo guards the Sync flow, but ResolveWorkspace is public — shouldn't this at least validate that the final path is deeper than the base before returning it?

Comment thread internal/sidecar/sync.go
)

const workspaceDir = "./workspace"
const workspaceDir = "/home/user"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old relative ./workspace worked regardless of which OS user ran the process. /home/user assumes the sidecar user is literally user — if the image ever changes the default user, or someone invokes this outside the expected sidecar, it silently targets the wrong location. Worth deriving from $HOME or an env var instead?

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.

2 participants