Skip to content

pi: honor BETTERWRIGHT_PROFILE for a separate persistent identity - #75

Open
ekenberg wants to merge 1 commit into
BetterWright:mainfrom
ekenberg:feat/pi-profile
Open

pi: honor BETTERWRIGHT_PROFILE for a separate persistent identity#75
ekenberg wants to merge 1 commit into
BetterWright:mainfrom
ekenberg:feat/pi-profile

Conversation

@ekenberg

Copy link
Copy Markdown
Contributor

The CLI and the MCP server both read BETTERWRIGHT_PROFILE so two processes
on one home can run as different signed-in identities; the docs describe the
env var as setting "the identity for a whole shell". The Pi extension
silently ignored it — so a second concurrent Pi session always contended for
the default profile and fell over to the ephemeral, signed-out fallback,
with no way to opt into a named persistent profile.

Resolve the profile eagerly (options.profile over the env var, mirroring
the MCP server's profileFromEnv semantics) so an invalid name fails at
extension load rather than as a mysteriously signed-out browser later, and
pass it to the constructed BetterWright alongside the other env-resolved
options. The three doc references to "which the MCP server reads too" now
include the Pi extension.

Testing

  • npm run release:check green.
  • Unit tests: an invalid profile (path-escaping name, via option and via
    env) throws at extension load; a valid name is accepted.
  • Verified live: two concurrent Pi sessions on one machine, one on the
    default profile, one with BETTERWRIGHT_PROFILE=scratch — no lock
    contention, both persistent, vault shared across both.

The CLI and the MCP server already read BETTERWRIGHT_PROFILE so two
processes on one home can run as different signed-in identities; the Pi
extension silently ignored it, so a second Pi session always contended
for the default profile and fell over to an ephemeral, signed-out one.
Resolve the profile eagerly (options.profile over the env var) so an
invalid name fails at extension load, and pass it to the browser like
the other env-resolved options.
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.

1 participant