Skip to content

dedup: import _load_env from helpers + add dupehound CI - #1

Open
giattijunior wants to merge 2 commits into
mainfrom
dedup/dupehound-pass1
Open

dedup: import _load_env from helpers + add dupehound CI#1
giattijunior wants to merge 2 commits into
mainfrom
dedup/dupehound-pass1

Conversation

@giattijunior

Copy link
Copy Markdown
Owner

Summary

First pass of dupehound integration: import _load_env from the existing canonical source in helpers.py, and add the CI workflow from upstream docs/ci.md.

Changes

Source

  • src/browser_harness/admin.py: remove local _load_env and _load_env_file definitions, import from helpers (was duplicated, identical 18-line body at admin.py:12-30).
  • src/browser_harness/daemon.py: same change (was duplicated at daemon.py:10-28).

helpers.py was already the canonical source — both _load_env and _load_env_file were defined there, and module-level _load_env() was called as a side effect on import.

CI

  • .github/workflows/dupehound.yml: scan (slop score) and check (--diff against base) jobs. check runs with continue-on-error: true — promote to gate after FP rate <10% over ~10 PRs.

Metrics

Before After
Slop score 0.9% 0.0%
Clusters 4 0
Deletable lines 18 0

Validation

  • pytest tests/unit/: 40/40 pass
  • dupehound check --diff fork/main . on this branch: clean (no new duplicates introduced)

admin.py and daemon.py each defined _load_env and _load_env_file
identically (admin.py: 12-30, daemon.py: 10-28). Both now import
from helpers.py, which is the canonical source (was already exporting
both via module-level _load_env() side effect).

CI:
- .github/workflows/dupehound.yml: scan (slop score) and check
  (--diff against base) jobs. check is continue-on-error for now;
  promote to gate after FP rate <10% over ~10 PRs.

Slop score: 0.9% -> 0.0% (4 -> 0 clusters, 18 lines eliminated).
40/40 unit tests pass.

@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: 61ded7f691

ℹ️ 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".



_load_env()
from .helpers import _load_env, _load_env_file

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid importing helper side effects from admin

Importing .helpers here immediately runs its module-level _load_agent_helpers(), so agent-workspace/agent_helpers.py is executed while browser_harness.admin is only partially initialized. If a task helper imports an admin API such as from browser_harness.admin import start_remote_daemon, the CLI now fails with a circular-import ImportError before any command runs; this worked before because run.py loaded admin before loading helpers. Move the env loader to a side-effect-free module or defer agent-helper loading to the CLI helper path.

Useful? React with 👍 / 👎.

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