Skip to content

fix(tests): restore missing __init__.py in tests/plugins/platforms#42393

Closed
teknium1 wants to merge 1 commit into
mainfrom
fix/photon-test-package-init
Closed

fix(tests): restore missing __init__.py in tests/plugins/platforms#42393
teknium1 wants to merge 1 commit into
mainfrom
fix/photon-test-package-init

Conversation

@teknium1

@teknium1 teknium1 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes the intermittent CI failure where shard test (2) reported file or directory not found: tests/plugins/platforms/photon/test_inbound.py even though the file was present and the same run showed 5269 passed, 0 failed.

Root cause

The package chain under tests/plugins/ was broken. Every sibling (tests/plugins/web, memory, tts, …) carries an __init__.py, but tests/plugins/platforms/ never had one and tests/plugins/platforms/photon/ lost its during the photon feature PR's "Windows footgun" cleanup commit. With pytest's default prepend import mode, a broken __init__.py chain makes the test module's rootpath resolution depend on cwd/sys.path state that the sharded per-file runner (scripts/run_tests_parallel.py --slice N/6) doesn't reliably reproduce — so the file is enumerated at plan time (--collect-only) but not found at per-file exec time on whichever shard it lands.

Changes

  • Add empty tests/plugins/platforms/__init__.py
  • Add empty tests/plugins/platforms/photon/__init__.py

Validation

Before After
Package chain tests/ → plugins/ → platforms/ → photon/ broken at platforms/ intact
scripts/run_tests_parallel.py tests/plugins/platforms/photon flaky "file not found" on shard 34/34 pass

Deterministic fix — no test-runner change required.

Infographic

Restoring the package chain

The photon plugin tests intermittently failed CI shard 'test (2)' with
'file or directory not found: test_inbound.py' despite the file being
present and '5269 passed, 0 failed' in the same run.

Root cause: the package chain under tests/plugins/ was broken. Every
sibling (tests/plugins/web, memory, tts, …) has an __init__.py, but
tests/plugins/platforms/ and tests/plugins/platforms/photon/ were
missing theirs — the photon feature PR's 'Windows footgun' cleanup
commit deleted the photon one, and the platforms/ level never had one.
With pytest's default prepend import mode, the broken chain makes the
module's rootpath resolution depend on cwd/sys.path state the sharded
per-file runner doesn't reliably reproduce, so the file resolves at
plan time (--collect-only) but not at per-file exec time on whichever
shard it lands.

Fix: add the two empty __init__.py files so the package chain matches
every sibling test package. Deterministic, no runner change needed.

Validation: package chain intact tests/ → plugins/ → platforms/ →
photon/; 34/34 photon tests pass through scripts/run_tests_parallel.py.
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

🔎 Lint report: fix/photon-test-package-init vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 10525 on HEAD, 10525 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 5529 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

@teknium1

teknium1 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

Closing — this fix was wrong. Adding the init.py files made the test tree importable as the dotted package 'plugins.platforms.photon', shadowing the real plugin at plugins/platforms/photon/. The plugin-interface test does importlib.import_module('plugins.platforms.photon') and resolved to the empty test init.py, so register() vanished (7 failures in test_plugin_platform_interface.py). The init.py absence was deliberate. Reverted; the original test_inbound.py collection flake needs a correct root-cause, not this.

@teknium1 teknium1 closed this Jun 8, 2026
@alt-glitch alt-glitch added type/test Test coverage or test infrastructure P3 Low — cosmetic, nice to have labels Jun 8, 2026
teknium1 added a commit that referenced this pull request Jun 9, 2026
AGENTS.md was almost entirely how-to/mechanics with the want/don't-want
guidance implicit and scattered. Adds a single authoritative intent layer
near the top, calibrated against what actually merges and what actually
gets rejected.

- 'What Hermes Is': framing + the two properties that drive design
  (prompt-cache integrity, narrow-waist core).
- 'Contribution Rubric': dual-purpose intent doc — (1) for humans/own work:
  what gets merged vs rejected; (2) for the triage sweeper: when a PR is safe
  to close on the three allowed reasons AND when NOT to close one. Taste-based
  'won't implement / out of scope' closes stay human-only by design.
  - 'What we want' calibrated against the last ~55 merges: fix real bugs well,
    expand reach at the edges (platforms/channels/providers/models/desktop —
    large features land routinely), refactor god-files into clean modules,
    keep the CORE narrow. 'Expansive at the edges, conservative at the waist.'
  - 'What we don't want': speculative hooks, .env-for-non-secrets, needless
    core tools, lazy-read escape hatches, feature-destroying fixes, ungated
    telemetry, change-detector tests, core-touching plugins.
  - 'Before you call it a bug — verify the premise (and when NOT to close)':
    distilled from real closes (#41741 intentional-design-not-a-gap, #41610
    wrong-premise, #42327 fix-never-executes, #42393 deliberate-omission,
    #41999 overreach). Doubles as sweeper guidance to avoid wrongly closing
    legitimate PRs.
- 'The Footprint Ladder' (core-tool decision): extend > CLI+skill > gated tool
  > plugin > MCP server in the catalog > new core tool (last resort).

Trim: 'Adding New Tools' intro points at the ladder. Detailed mechanics stay
where readers need them.
teknium1 added a commit that referenced this pull request Jun 10, 2026
#42641)

AGENTS.md was almost entirely how-to/mechanics with the want/don't-want
guidance implicit and scattered. Adds a single authoritative intent layer
near the top, calibrated against what actually merges and what actually
gets rejected.

- 'What Hermes Is': framing + the two properties that drive design
  (prompt-cache integrity, narrow-waist core).
- 'Contribution Rubric': dual-purpose intent doc — (1) for humans/own work:
  what gets merged vs rejected; (2) for the triage sweeper: when a PR is safe
  to close on the three allowed reasons AND when NOT to close one. Taste-based
  'won't implement / out of scope' closes stay human-only by design.
  - 'What we want' calibrated against the last ~55 merges: fix real bugs well,
    expand reach at the edges (platforms/channels/providers/models/desktop —
    large features land routinely), refactor god-files into clean modules,
    keep the CORE narrow. 'Expansive at the edges, conservative at the waist.'
  - 'What we don't want': speculative hooks, .env-for-non-secrets, needless
    core tools, lazy-read escape hatches, feature-destroying fixes, ungated
    telemetry, change-detector tests, core-touching plugins.
  - 'Before you call it a bug — verify the premise (and when NOT to close)':
    distilled from real closes (#41741 intentional-design-not-a-gap, #41610
    wrong-premise, #42327 fix-never-executes, #42393 deliberate-omission,
    #41999 overreach). Doubles as sweeper guidance to avoid wrongly closing
    legitimate PRs.
- 'The Footprint Ladder' (core-tool decision): extend > CLI+skill > gated tool
  > plugin > MCP server in the catalog > new core tool (last resort).

Trim: 'Adding New Tools' intro points at the ladder. Detailed mechanics stay
where readers need them.
changman pushed a commit to changman/hermes-agent that referenced this pull request Jun 10, 2026
NousResearch#42641)

AGENTS.md was almost entirely how-to/mechanics with the want/don't-want
guidance implicit and scattered. Adds a single authoritative intent layer
near the top, calibrated against what actually merges and what actually
gets rejected.

- 'What Hermes Is': framing + the two properties that drive design
  (prompt-cache integrity, narrow-waist core).
- 'Contribution Rubric': dual-purpose intent doc — (1) for humans/own work:
  what gets merged vs rejected; (2) for the triage sweeper: when a PR is safe
  to close on the three allowed reasons AND when NOT to close one. Taste-based
  'won't implement / out of scope' closes stay human-only by design.
  - 'What we want' calibrated against the last ~55 merges: fix real bugs well,
    expand reach at the edges (platforms/channels/providers/models/desktop —
    large features land routinely), refactor god-files into clean modules,
    keep the CORE narrow. 'Expansive at the edges, conservative at the waist.'
  - 'What we don't want': speculative hooks, .env-for-non-secrets, needless
    core tools, lazy-read escape hatches, feature-destroying fixes, ungated
    telemetry, change-detector tests, core-touching plugins.
  - 'Before you call it a bug — verify the premise (and when NOT to close)':
    distilled from real closes (NousResearch#41741 intentional-design-not-a-gap, NousResearch#41610
    wrong-premise, NousResearch#42327 fix-never-executes, NousResearch#42393 deliberate-omission,
    NousResearch#41999 overreach). Doubles as sweeper guidance to avoid wrongly closing
    legitimate PRs.
- 'The Footprint Ladder' (core-tool decision): extend > CLI+skill > gated tool
  > plugin > MCP server in the catalog > new core tool (last resort).

Trim: 'Adding New Tools' intro points at the ladder. Detailed mechanics stay
where readers need them.
alt-glitch pushed a commit that referenced this pull request Jun 14, 2026
#42641)

AGENTS.md was almost entirely how-to/mechanics with the want/don't-want
guidance implicit and scattered. Adds a single authoritative intent layer
near the top, calibrated against what actually merges and what actually
gets rejected.

- 'What Hermes Is': framing + the two properties that drive design
  (prompt-cache integrity, narrow-waist core).
- 'Contribution Rubric': dual-purpose intent doc — (1) for humans/own work:
  what gets merged vs rejected; (2) for the triage sweeper: when a PR is safe
  to close on the three allowed reasons AND when NOT to close one. Taste-based
  'won't implement / out of scope' closes stay human-only by design.
  - 'What we want' calibrated against the last ~55 merges: fix real bugs well,
    expand reach at the edges (platforms/channels/providers/models/desktop —
    large features land routinely), refactor god-files into clean modules,
    keep the CORE narrow. 'Expansive at the edges, conservative at the waist.'
  - 'What we don't want': speculative hooks, .env-for-non-secrets, needless
    core tools, lazy-read escape hatches, feature-destroying fixes, ungated
    telemetry, change-detector tests, core-touching plugins.
  - 'Before you call it a bug — verify the premise (and when NOT to close)':
    distilled from real closes (#41741 intentional-design-not-a-gap, #41610
    wrong-premise, #42327 fix-never-executes, #42393 deliberate-omission,
    #41999 overreach). Doubles as sweeper guidance to avoid wrongly closing
    legitimate PRs.
- 'The Footprint Ladder' (core-tool decision): extend > CLI+skill > gated tool
  > plugin > MCP server in the catalog > new core tool (last resort).

Trim: 'Adding New Tools' intro points at the ladder. Detailed mechanics stay
where readers need them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low — cosmetic, nice to have type/test Test coverage or test infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants