Repository navigation
Conversation
…ak was the subagent seam, no separate main-turn bug
…state.db not lcm.db; agent.log fan-out is the load-bearing proof, store-absence corroborating (state.db hygiene trimmed the leak minute)
…live-verified post-restart)
… terminal context-bleed discovery logged
🔎 Lint report:
|
| Rule | Count |
|---|---|
unresolved-attribute |
2 |
First entries
run_agent.py:2940: [unresolved-attribute] unresolved-attribute: Object of type `Self@get_credits_spent_micros` has no attribute `_credits_session_start_micros`
tests/run_agent/test_credits_notices_toggle.py:76: [unresolved-attribute] unresolved-attribute: Unresolved attribute `_credits_session_start_micros` on type `AIAgent`
✅ Fixed issues (1):
| Rule | Count |
|---|---|
invalid-assignment |
1 |
First entries
tests/run_agent/test_credits_notices_toggle.py:76: [invalid-assignment] invalid-assignment: Object of type `None` is not assignable to attribute `_credits_session_start_micros` of type `int`
Unchanged: 5939 pre-existing issues carried over.
Diagnostics are surfaced as warnings — this check never fails the build.
| - The two "pre-existing red" test classes (`test_hardline_blocklist`, `TestDelegateHeartbeat`) were **investigated and fixed**, not WONTFIX'd (PR #92, merged `eb7b4651c`): | ||
| - `test_hardline_blocklist` (24 reboot/shutdown cases + yolo-bypass): the live fleet sets `HERMES_ALLOW_REBOOT=1` (legit ops opt-out, `74ed8a85c`), which leaks into pytest's inherited env and downgrades the reboot family out of the hardline floor → the default-block tests fail. Fixed with an autouse `monkeypatch.delenv("HERMES_ALLOW_REBOOT")`. Deterministic in both ambient states. | ||
| - `TestDelegateHeartbeat` (3 timing-brittle tests): asserted wall-clock-derived touch counts; the heartbeat thread's wake cadence is GIL/scheduler-bound, so on a loaded host they produced too few touches. Rewrote to assert the **behavior contract** (heartbeat still alive late in the run / ≥1 touch with pinned thresholds) instead of a count. Verified 6/6 green under a 6-thread CPU burn. | ||
| - The v2-spec OQ2 docs correction shipped (PR #91). |
There was a problem hiding this comment.
Cross-reference to PR #91 may be inaccurate
The addendum states "The v2-spec OQ2 docs correction shipped (PR #91)", but the OQ2 section in PRD-send-message-origin-leak-v2.md is also being changed in this PR (#93) — from the old open question to the full "RESOLVED (2026-06-22)" forensic write-up. If PR #91 already made a partial OQ2 update, the addendum should clarify what specifically shipped in #91 vs. what is being added here, so future readers tracing the change history aren't misled about which commit holds the authoritative resolution.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| - `TestDelegateHeartbeat` (3 timing-brittle tests): asserted wall-clock-derived touch counts; the heartbeat thread's wake cadence is GIL/scheduler-bound, so on a loaded host they produced too few touches. Rewrote to assert the **behavior contract** (heartbeat still alive late in the run / ≥1 touch with pinned thresholds) instead of a count. Verified 6/6 green under a 6-thread CPU burn. | ||
| - The v2-spec OQ2 docs correction shipped (PR #91). | ||
|
|
||
| **DISCOVERY (latent, BACKLOG — NOT a v3 regression, NO routing leak):** the `terminal` tool's subprocess can inherit a *different concurrently-active session's* contextvars (a `no_agent` cron job's `set_cron_session()` bleeds the whole `HERMES_SESSION_*` block — incl. `HERMES_CRON_SESSION=1` and that cron session's `SESSION_ID`/`CHAT_ID`/`KEY` — into an interactive turn's terminal env). It bleeds **every** session var, not just the cron flag, so it's a general context-inheritance issue, pre-existing, exposed (not caused) by adding `HERMES_CRON_SESSION` to `_VAR_MAP`. It does **not** misroute `send_message` (which reads the model's turn context — live-verified routing to the current channel). Practical impact: the Mechanism-4 `terminal env|grep HERMES_CRON_SESSION` diagnostic now gives false positives — **cross-check with the in-process `execute_code` read** (`gateway.session_context.is_cron_session()`), which is authoritative. The `agent-message-misrouting-diagnosis` skill was updated with this caveat. Promotion trigger: if it ever causes a real cross-context terminal action (a cron-spawned terminal command running with interactive creds or vice versa). |
There was a problem hiding this comment.
Severity of
KEY bleed in BACKLOG item may be understated
The discovery section describes the terminal context-bleed as primarily a "diagnostic false-positive" issue, but the bleed includes HERMES_SESSION_KEY (a session auth key) alongside SESSION_ID and CHAT_ID. If any terminal command in an interactive turn inherits a concurrently-active cron session's KEY and uses it to authenticate outbound calls, that is a real cross-context auth boundary violation — not just a false positive in env|grep. The "Promotion trigger" covers the scenario but frames it as a future concern, when the credential cross-contamination is present in the current environment any time a cron job and an interactive terminal command overlap. Worth noting explicitly in the BACKLOG entry that the KEY bleed itself is the latent security surface, even if no routing misuse has been observed.
|
Superseded: the v3 closeout-addendum content this PR adds is already on main (shipped via #88/#91/#92, 2026-06-22 — |
Closeout addendum for the v3 cron-session-latch PRD: the two pre-existing test reds were fixed (PR #92, not WONTFIX), and a latent terminal-tool context-bleed was discovered during live re-verification (logged as BACKLOG — not a v3 regression, no routing leak). Docs only.