Skip to content

fix(cron): scope approval context to each job - #1

Closed
thaingo72-ctrl wants to merge 2 commits into
mainfrom
fix/cron-context-isolation-20260730
Closed

fix(cron): scope approval context to each job#1
thaingo72-ctrl wants to merge 2 commits into
mainfrom
fix/cron-context-isolation-20260730

Conversation

@thaingo72-ctrl

Copy link
Copy Markdown
Owner

Summary

  • replace process-global cron-session approval marker with ContextVar state
  • propagate the marker through cron worker contexts and reset its token in finally
  • suppress stale env fallback for bound gateway sessions while preserving standalone cron compatibility
  • make cron deny policy authoritative for terminal, execute_code, and plugin escalation paths

This is a current-main manual port of the reviewed behavior in upstream PR NousResearch#58663, preserving newer scheduler/gateway work.

Verification

  • RED: 12/12 new isolation regressions failed on unpatched current main
  • GREEN: 442 cron/affected approval tests passed
  • Ruff: passed
  • compileall: passed
  • git diff --check: passed
  • two independent security/concurrency reviews: PASS

Safety

No state, credentials, platform identifiers, plugins, skills, or production configuration are included.

@thaingo72-ctrl

Copy link
Copy Markdown
Owner Author

Superseded by the tree-identical noreply-attribution PR; no code changes.

@thaingo72-ctrl
thaingo72-ctrl deleted the fix/cron-context-isolation-20260730 branch July 30, 2026 09:47
thaingo72-ctrl pushed a commit that referenced this pull request Aug 2, 2026
…own (NousResearch#74136)

Fix-up for the cherry-picked cooldown persistence: the PR's tests mocked
the DB (SimpleNamespace(_db=MagicMock())), which cannot prove the cooldown
survives a restart. Replace with the production shape — a real SessionDB
on disk behind the real AsyncSessionDB facade — and add a restart
regression: fail a hygiene compression on runner #1, tear it down, build a
fresh GatewayRunner on the SAME database, and assert the cooldown is still
honored (no compression agent instantiated). Also updates the timeout test
to assert the DB-backed record_compression_failure_cooldown write instead
of the removed in-memory dict.

Sabotage-verified: reverting gateway/run.py to the in-memory dict makes
the restart test fail.
thaingo72-ctrl pushed a commit that referenced this pull request Aug 2, 2026
Users following abbreviated links guess /docs/quickstart and
/docs/installation and hit raw GitHub-Pages 404s — the real pages live
under /docs/getting-started/. Add client redirects for both.

Consumer-onboarding audit finding #1, Aug 2026.
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