Repository navigation
feat(repo): --carry-login lets an isolated reach probe use the operator's sign-in and no settings - #1582
Conversation
…or's sign-in and no settings A Codex signed in with codex login keeps its credential in CODEX_HOME/auth.json; reach and skill-reach give the harness a fresh CODEX_HOME, so every scenario failed 401 Missing bearer. --carry-login copies only auth.json into the run's own CODEX_HOME (owner-readable), or forwards CLAUDE_CODE_OAUTH_TOKEN for Claude Code. Config, skills and memory stay out. A missing login is a usage error, and harness.isolation records login isolated (default) or carried. Signed-off-by: vchamarthi <123653452+vchamarthi@users.noreply.github.com>
CLI interface change detectedThis PR changes dokimi's user-facing CLI surface (commands and/or options): ~ `dokimi repo reach` parameters changed:
+ added option `--carry-login`
~ `dokimi repo run` parameters changed:
+ added option `--carry-login`
~ `dokimi repo skill-reach` parameters changed:
+ added option `--carry-login`Updated on every push; the |
There was a problem hiding this comment.
🟡 Changes recommended
Credential copying and cleanup can expose or retain live logins, while execution IDs fail to distinguish login modes, allowing incompatible results to be reused.
5 open issues
Include login isolation in the batch execution identity · New Remove carried credentials from retained reach fixtures · New Write credentials to a secure temporary file before replacing the destination · New Start cleanup protection before writing the login config · New Isolate HOME and config paths for reach measurements · New
What changed in this PR
5 findings. Adds --carry-login so Dokimi’s repository probes and batch runs can use an operator’s Codex or Claude Code sign-in.
Changes:
- Adds opt-in credential copying or token forwarding and isolation metadata.
- Updates schemas, documentation, CLI snapshots, and regression tests.
- Extracts reporting commands and batch-spend helpers into separate modules.
| File | Description |
|---|---|
dokimi/tests/test_repo_run_reports.py |
Tests compare argument forwarding. |
dokimi/tests/test_repo_run_carry_login.py |
Tests batch credential handling and metadata. |
dokimi/tests/test_repo_reach_carry_login.py |
Tests login copying, forwarding, and refusals. |
dokimi/tests/test_batch_ledger_golden.py |
Adds the isolation metadata key. |
dokimi/tests/data/cli_flags_allowlist.txt |
Registers the new flag. |
dokimi/dokimi/schemas/skill_discovery.v1.json |
Describes skill-probe isolation metadata. |
dokimi/dokimi/schemas/guidance_reach.v1.json |
Describes reach-probe isolation metadata. |
dokimi/dokimi/repos/skill_reach.py |
Records login isolation. |
dokimi/dokimi/repos/runner.py |
Forwards credentials, cleans up, and records isolation. |
dokimi/dokimi/repos/reach.py |
Records login isolation. |
dokimi/dokimi/repos/login_carry.py |
Implements credential validation, copying, and cleanup. |
dokimi/dokimi/repos/harness_profile.py |
Integrates login carrying into profiles. |
dokimi/dokimi/repos/batch_spend.py |
Houses extracted spend helpers. |
dokimi/dokimi/commands/repo_skill_reach.py |
Adds skill-reach flag handling. |
dokimi/dokimi/commands/repo_run.py |
Adds batch flag handling and extracts reporting. |
dokimi/dokimi/commands/repo_run_reports.py |
Houses report and compare commands. |
dokimi/dokimi/commands/repo_reach.py |
Adds reach flag handling and replay restrictions. |
dokimi/dokimi/cli_flags.py |
Defines shared flag help. |
dokimi/docs/repo-evaluation-contract.md |
Documents credential-carrying behavior. |
dokimi/docs/reference/cli-interface.json |
Updates the CLI snapshot. |
dokimi/changelog.d/20261202_120000_vchamarthi_carry-login.md |
Announces the feature. |
Review effort: Balanced
|
OpenCodeReview: Commit 589a216 was not reviewed. This PR has reached its review limit (6 reviews). CI at `589a216`: 6 still running, 20 passing, 3 skipped
To review this commit: re-request review from exai-bot in the Reviewers list. Last review (0519e52): 1 mediumOpen threads from the bot: 0 |
Mutation of changed linesAt 589a216: 46 caught · 0 missed · 34 not tried in time This is not a clean result:
Warning only: a missed break does not fail the job. Updated on every push; the full report is in the ci run summary. |
- execution_id includes a carried login, so a resume in the other mode does not reuse its cells; default ids are unchanged - copy_login creates the file 0600 through a temp file and leaves none behind on failure - repo run drops the login whatever fails after write_config - repo reach and skill-reach drop the login from a --keep fixture - a carried reach run gets a fixture HOME - move the overlay note lines to reach_overlays.py to stay under the cap Signed-off-by: vchamarthi <123653452+vchamarthi@users.noreply.github.com>
|
This is ready for another look: I've pushed 1 commit on Changes:
Threads:
Not caused by this PR:
What I checked on the new commit: all 2 new tests fail before the fix and pass after it; the full test suite passes with main merged in (35,629 tests), apart from 2 failures main has too. What each test shows
|
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1582 +/- ##
==========================================
- Coverage 96.47% 96.42% -0.06%
==========================================
Files 564 578 +14
Lines 74672 75905 +1233
Branches 12890 13065 +175
==========================================
+ Hits 72042 73191 +1149
- Misses 1610 1658 +48
- Partials 1020 1056 +36
🚀 New features to boost your workflow:
|
vlad-perevezentsev
left a comment
There was a problem hiding this comment.
🟡 Changes needed · reviewed 77ca68e
To fix: a Codex token refresh in a carried run is lost and can sign the operator out, and after a rebase on main one new import fails the import test (line comments); the record and refusal gaps there matter less. To answer: how this PR and #1563 share CLAUDE_CODE_OAUTH_TOKEN.
✅ GitHub CI on 77ca68e: 27 jobs pass · ❌ on the merge with current main: 1,645 passed, test_import_architecture.py::test_package_uses_the_new_modules fails · ✅ Windows (Server 2025, Python 3.13): the reach and hardening tests, 17 passed, and the copied auth.json is byte-identical (the repo run ones need Linux, as on main)
The login copy is now private, dropped on every path, and part of the execution id.
|
|
||
|
|
||
| def with_login(profile: HarnessProfile, environ: Mapping[str, str] | None = None) -> HarnessProfile: | ||
| """``profile`` set to carry the login; a ProfileError when it has no known login or the login is missing.""" |
There was a problem hiding this comment.
Nit: The docstring says with_login raises a ProfileError, but it raises LoginError, which is not one.
A caller that trusts it and catches ProfileError lets the refusal through as a traceback. Also the comment at cli_flags.py:605 and the cli_flags_allowlist.txt entry name only repo reach/repo skill-reach, while repo run has the flag too.
Suggestion: say LoginError here and add repo run to both.
There was a problem hiding this comment.
This was already fixed in 2ee4163c5: the with_login docstring at dokimi/dokimi/repos/login_carry.py:54 now says it raises LoginError, and the comment at cli_flags.py:638 and the --carry-login entry in cli_flags_allowlist.txt:31 both name repo reach/skill-reach/run.
Signed-off-by: vchamarthi <123653452+vchamarthi@users.noreply.github.com>
- Write a Codex login the harness refreshed back to its source (0600, atomic) before dropping the run's copy, so the rotated refresh token is not lost. - Refuse --carry-login when the login file is unreadable, or when a credential that wins over it (CODEX_API_KEY, ANTHROPIC_API_KEY, ...) is forwarded and set. - Forward CLAUDE_CODE_OAUTH_TOKEN once now that claude-code's env_allow has it. - Say only what holds in the default isolation note. - Import InputError from dokimi.files in repo_run_reports. - Name LoginError in with_login's docstring and add repo run to the --carry-login flag comment and allowlist row. Signed-off-by: vchamarthi <123653452+vchamarthi@users.noreply.github.com>
|
@vlad-perevezentsev, this is ready for another look: 2 commits on PR description updated:
Your comment:
Threads:
What I checked on the new commit: all 6 new tests fail before the fix and pass after it; the full test suite passes with main merged in (36,430 tests), apart from 1 failure main has too. What each test shows
|
napetrov
left a comment
There was a problem hiding this comment.
Change class: ARCHITECTURAL (head 2ee4163)
- Contract: changed. errors dokimi/dokimi/commands/repo_run_reports.py:20; errors dokimi/dokimi/commands/repo_run_reports.py:28
- Responsibility: changed. move cmd_repo_report from dokimi/dokimi/commands/repo_run.py to dokimi/dokimi/commands/repo_run_reports.py; move _print_leaf from dokimi/dokimi/commands/repo_run.py to dokimi/dokimi/commands/repo_run_reports.py
- Dependency: changed (count signal only, no file:line)
- Review depth: design read: new dependency/responsibility, ask for rationale
- Coverage gaps: none
Open issues to resolve on 2ee4163c.
- The default sign-in preflight still needs credential cleanup in retained directories. Earlier finding
- Credential refresh should verify the replacement file before updating the operator’s login. Earlier finding
Give sign-in preflight the same credential cleanup as the main run and validate refreshed credential files before updating the operator copy.
Reviewed the diff, edge cases and prior threads. Credential handling was reviewed statically. Live logins and token refresh were outside coverage. The full local suite was outside coverage.
- checked_version and check_container_signed_in drop the copied login (and write a refresh back) on every path, including a refused sign-in. - The write-back refuses a link (lstat first, then O_NOFOLLOW and an fstat check, so it also holds where O_NOFOLLOW does not exist) and only reads a regular file. - A refreshed copy that cannot be read raises instead of being dropped. - A competing credential set in the profile's env_set is refused like one forwarded from the shell. - A failed write-back after the agent ran is noted in trace_errors, so the cell is still graded and its charge counted. Signed-off-by: vchamarthi <123653452+vchamarthi@users.noreply.github.com>
|
@napetrov, this is ready for another look: 1 commit on Your comment:
Threads:
What I checked on the new commit:
What each test shows
|
check_container_signed_in let an OSError from drop_login escape before the call's charge was returned, so repo run lost the spend. The failure is now reported on stderr and the charge is returned. Signed-off-by: vchamarthi <123653452+vchamarthi@users.noreply.github.com>
|
This is ready for another look: I've pushed 1 commit on Changes:
Threads:
What I checked on the new commit: the new test fails before the fix and passes after it; the full test suite passes with main merged in (36,829 tests), apart from 1 failure main has too. What each test shows
|
antonwolfy
left a comment
There was a problem hiding this comment.
Review at 3842942. The earlier rounds' fixes hold: the 0600 copy, cleanup in every probe and preflight path, write-back with no link following, and the execution id all behave as described. Two risks are left, both in login_carry.py.
What I ran, on a Linux review host at 3842942:
make ci-local: 38 passed, 0 failed, 16 skipped (matrix legs on other Pythons and the merge with currentmainare not covered). 35,619 tests passed, 28 skipped, total coverage 97%.- Reproductions for both findings, with no model or network call.
- Mutation of the override list (see the inline comment).
Checked, no issues
- Commits: all five non-merge commits carry
Signed-off-by. - Schemas and docs:
harness.isolationis described in both schemas, the flag is in the CLI snapshot and the allowlist, and the changelog fragment is present. - Moved code:
repo report/repo compareand the spend helpers are re-exported, and the new tests pass against the moved names.
copy_login resolves the login source, so a refreshed login is written back to the real file instead of replacing the link. Tests also cover every override name that makes --carry-login refuse. Signed-off-by: vchamarthi <123653452+vchamarthi@users.noreply.github.com>
|
@antonwolfy, this is ready for another look: 1 commit on Your comment:
Threads:
What I checked on the new commit: the new test fails before the fix and passes after it; the full test suite passes with main merged in (36,976 tests), apart from 1 failure main has too. What each test shows
|
napetrov
left a comment
There was a problem hiding this comment.
Change class: ARCHITECTURAL (head 0519e52)
- Contract: changed. errors dokimi/dokimi/commands/repo_run_reports.py:20; errors dokimi/dokimi/commands/repo_run_reports.py:28
- Responsibility: changed. move cmd_repo_report from dokimi/dokimi/commands/repo_run.py to dokimi/dokimi/commands/repo_run_reports.py; move _print_leaf from dokimi/dokimi/commands/repo_run.py to dokimi/dokimi/commands/repo_run_reports.py
- Dependency: changed (count signal only, no file:line)
- Review depth: design read: new dependency/responsibility, ask for rationale
- Coverage gaps: none
Follow-up question.
--carry-login carries the operator sign-in into a fresh run for Codex and Claude Code. The review focused on identity, credential lifetime, retained outputs, and accounting.
Review with #1559 and #1654. The paired merges conflict in the reach/CLI surfaces and harness profile, respectively.
CI on head 0519e52: 0 failing Actions jobs; merge base 1bf62d3 is behind base tip 5225c2a.
Compared the change and input edges against the merge base and checked existing threads and GitHub Actions. Runtime checks used local fixtures. Live credentials and external path access were outside the review. Focused tests on the head: extra 7 passed in 4.97s.
The digest compare and the write-back of a refreshed Codex login were separate steps under a process-local lock, so two dokimi runs refreshing the same login could overwrite each other. Hold an exclusive file lock next to the login file around both. Signed-off-by: vchamarthi <123653452+vchamarthi@users.noreply.github.com>
|
@napetrov, this is ready for another look: 1 commit on Changes:
Threads:
What I checked on the new commit: the new test fails before the fix and passes after it; the full test suite passes with main merged in (37,093 tests), apart from 1 failure main has too. What each test shows
|
napetrov
left a comment
There was a problem hiding this comment.
Change class: ARCHITECTURAL (head 589a216)
- Contract: changed. errors dokimi/dokimi/commands/repo_run_reports.py:20; errors dokimi/dokimi/commands/repo_run_reports.py:28
- Responsibility: changed. move cmd_repo_report from dokimi/dokimi/commands/repo_run.py to dokimi/dokimi/commands/repo_run_reports.py; move _print_leaf from dokimi/dokimi/commands/repo_run.py to dokimi/dokimi/commands/repo_run_reports.py
- Dependency: changed (count signal only, no file:line)
- Review depth: design read: new dependency/responsibility, ask for rationale
- Coverage gaps: none
Ready for approval.
The previous write-back question is addressed for concurrent Dokimi processes. A paired merge with #1654 still needs a manual reconciliation in harness_profile.py.
CI on head 589a216: 0 failing Actions jobs; merge base 1bf62d3 is behind base tip 60948d0.
Checked the source lock, acquisition and cleanup ordering, two focused tests using synthetic login data, required CI, and a merge with current main. Runtime coverage was Linux with fixture credentials.


Why
repo reachandrepo skill-reachgive the harness a fresh config dir per run, so your config, skills and memory cannot leak in. A Codex signed in withcodex loginkeeps its credential in that dir (auth.json), so in a probe it has no bearer.repo reach <repo> --harness codex --only cwd=.on IntelPython/mkl-service: every scenario failed with401 Unauthorized: Missing bearer or basic authentication.What changes
--carry-loginonrepo reach,repo skill-reachandrepo run. The default stays fully isolated.auth.json(from$CODEX_HOME, else~/.codex) into the run's own CODEX_HOME, readable by the owner only. Config, skills, memory andAGENTS.mdstay behind.CLAUDE_CODE_OAUTH_TOKEN(fromclaude setup-token, which the profile forwards) to be set, and records it as the carried login. The config dir is still the run's own.harness.isolationinreach.jsonandskill-discovery.jsonrecordslogin: isolated(the default) orlogin: carried, with the note "login carried, settings not". Both schemas describe the new field.repo run: the token reaches the agent's container by name only (never by value in the spec). The copiedauth.jsonis removed from the cell's kept config dir once the agent exits, even on a crash. Each cell'smeta.jsongets the sameisolationrecord, so the batch-ledger golden key list gainsisolation.repo report/repo comparemove tocommands/repo_run_reports.pyand the batch spend reserve/read/write helpers move torepos/batch_spend.py. Behaviour is unchanged and the runner re-exports the names.dokimi/repos/login_carry.py.HarnessProfilegainscarry_login, whichwrite_configandenvhonour. Also updated: the CLI snapshot, the flag allowlist row, the contract doc and a changelog fragment.Evidence
Measured with Dokimi on Codex (codex-cli 0.171.0, gpt-6.2-sol),
repo reach <mkl-service> --harness codex --only cwd=.:cwd=.AGENTS.mdharness.isolationlogin: isolated--carry-login)login: carried, files["auth.json"]How to test
One of the 2 failures also fails on unchanged main:
test_repo_compare_interval::test_the_row_p_places_zero_where_large_deltas_round_p_at_zero_apart. The other wastest_batch_ledger_golden, which pins themeta.jsonkeys. It was updated for the newisolationkey, and it now passes (5 passed).schema_compatshows only the two expected warnings for the newharness.isolationproperty.Live check, one cheap call (needs a signed-in Codex):
Mutation
The PR's mutation check missed 2 mutants. Both were in the moved
repo comparelines (the--armsplit and the--metricdefault). Tests were added for both intests/test_repo_run_reports.py. The check now reports 27 caught and 0 missed (53 not tried in time).References
codex login,auth.jsonin CODEX_HOME): https://developers.openai.com/codex/auth