Skip to content

feat: export DEVA_AUTH_TAG for in-container account identity - #497

Merged
lroolle merged 1 commit into
mainfrom
feat/auth-tag-env
Jul 27, 2026
Merged

feat: export DEVA_AUTH_TAG for in-container account identity#497
lroolle merged 1 commit into
mainfrom
feat/auth-tag-env

Conversation

@lroolle

@lroolle lroolle commented Jul 27, 2026

Copy link
Copy Markdown
Member

Export the auth tag deva already computes for container naming
(auth-default | auth-file- | api-key- | env) as
DEVA_AUTH_TAG env in every container.

Why: multi-account runs (--auth-with a.credentials.json vs
b.credentials.json) are indistinguishable from inside. The credentials
file holds no identity (tokens rotate) — the runner is the only party
that knows which account a container talks as. First consumer:
claude-code-statusline account chip + per-account cache scoping.

  • hoist generate_auth_tag() out of the name-rewrite branch, one export
  • naming and deva.auth_tag label unchanged
  • verified all three modes via scratch-HOME --dry-run

Close #496

🤖 Generated with Claude Code

- generate_auth_tag() ran only inside the container-name rewrite
  branch; hoist it and export the result as DEVA_AUTH_TAG on every run
- credentials files carry no identity (tokens rotate), so the runner
  is the only party that knows which account a container talks as
- first consumer: claude-code-statusline account chip + per-account
  cache scoping (the shared ~/.claude/statusline caches bleed across
  accounts when containers overlay different credentials on one home)
- container naming and deva.auth_tag label unchanged

Close #496

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 27, 2026 16:23
@claude-yolo

claude-yolo Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Claude encountered an error after 1s —— View job


I'll analyze this and get back to you.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 83db928c41

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread deva.sh
# carries no identity (tokens rotate) — the tag is the only stable handle
# for WHICH account this container runs as. claude-code-statusline keys
# its per-account cache scoping and account chip on it.
DOCKER_ARGS+=(-e "DEVA_AUTH_TAG=${_auth_tag}")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Pass the auth tag when attaching to existing containers

When a persistent container was created before this version, adding DEVA_AUTH_TAG only to DOCKER_ARGS does not expose it to the launched agent: the attach path skips docker run and invokes docker exec with only the trace override. Upgraded users therefore continue without the tag—and the intended per-account cache isolation—until they manually delete and recreate every persistent container; pass the computed tag as an exec-time environment override as well.

Useful? React with 👍 / 👎.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR exposes Deva’s existing “auth tag” (already used for container naming and the deva.auth_tag Docker label) inside every launched container as DEVA_AUTH_TAG, enabling in-container tooling to reliably distinguish which account/session identity a container is running under (e.g., for multi-account --auth-with runs).

Changes:

  • Hoists generate_auth_tag(...) so it’s computed once and reused for container naming and deva.auth_tag labeling.
  • Exports the computed tag into the container environment as DEVA_AUTH_TAG via DOCKER_ARGS.
  • Documents the new environment variable in CHANGELOG.md and records the rationale in DEV-LOGS.md.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
deva.sh Computes auth tag once and injects it into containers as DEVA_AUTH_TAG, while keeping naming/label behavior consistent.
DEV-LOGS.md Adds a dev log entry explaining the multi-account motivation and expected impact (#496).
CHANGELOG.md Notes the new DEVA_AUTH_TAG container environment variable under Unreleased.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@lroolle
lroolle merged commit 2d5d776 into main Jul 27, 2026
7 of 8 checks passed
@lroolle
lroolle deleted the feat/auth-tag-env branch July 27, 2026 16:36
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.

Export DEVA_AUTH_TAG for in-container account identity

2 participants