Skip to content

fix(phone): apply --home early for codeaf phone serve (#3020) - #3022

Open
Pybsama wants to merge 2 commits into
Agent-Field:devfrom
Pybsama:fix/phone-serve-home-early-3020
Open

Pybsama wants to merge 2 commits into
Agent-Field:devfrom
Pybsama:fix/phone-serve-home-early-3020

Conversation

@Pybsama

@Pybsama Pybsama commented Dec 2, 2026

Copy link
Copy Markdown

Fixes #3020.

Summary

  • Extend useAppHomeEarly in cmd/codeaf/app_home.go so codeaf phone serve --home <dir> applies --home at the start of main (using the same newPhoneServeFlags() and reorder(...) parsing as runPhoneContext), matching codeaf app --home <dir>.
  • Ensures home.Adopt, home.Witness, and startup telemetry config lookup read the --home folder instead of the default CODEAF_HOME / ~/.codeaf.
  • Add unit tests in cmd/codeaf/app_home_login_test.go covering phone serve --home flag forms (--home, --home=, -home, --accept-older-list --home), non-serve negative cases, and verifying telemetryConfiguredOff() reads from --home rather than $HOME/.codeaf.
  • Add the matching changelog entry under docs/changes/unreleased/.

Verification

  • make test-focus PKGS=./cmd/codeaf RUN='^(TestAppHome|TestAppWithoutHome|TestPhoneServeHome)' — passed (1.270s)
  • go test -race -count=1 ./cmd/codeaf -run '^(TestAppHome|TestAppWithoutHome|TestPhone)' — passed (2.823s)
  • make test-quick (build-check, vet incl. GOOS=windows, fmt-check, test-packed-manual, changelog-check, manual-gates, test-laws, test-carried-help, test-belt-pages) — verified after adding the numbered changelog entry
  • Real CLI replication with scratch HOME and unset CODEAF_HOME: codeaf phone serve --home <tmp-state> printed error: no phone is paired with this computer yet. Approve one first, then run this again. and did not create $HOME/.codeaf.

Limitations

  • Live paired-phone / relay end-to-end tests were not run; verification covers the local startup/flag/home/telemetry path and make test-quick.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@santoshkumarradha

Copy link
Copy Markdown
Member

Hey, thanks for the PR. Could you sign the CLA when you get a chance so we can review it?

This branch has not been deployed

No deployments
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.

codeaf phone serve --home is applied after the default home has already been read

3 participants