Skip to content

Pause scheduled LLM work while Skyrim is inactive - #702

Merged
RANGROO merged 2 commits into
unstablefrom
codex/discord-1537526616870363217-stop-offline-llm
Aug 15, 2026
Merged

Pause scheduled LLM work while Skyrim is inactive#702
RANGROO merged 2 commits into
unstablefrom
codex/discord-1537526616870363217-stop-offline-llm

Conversation

@RANGROO

@RANGROO RANGROO commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Problem

HerikaServer's scheduled middle-term service keeps running after Skyrim stops sending game traffic. Its global summary and middle-term connector defaults can use DeepSeek V4 Pro independently of every profile, so the background loop can continue consuming OpenRouter credits while the game is closed.

Discord source: Open Discord thread

Changes

  • move shared Skyrim activity tracking into lib/game_activity.php
  • use global chimMarkGameActivity() and chimHasRecentGameActivity() APIs from the request path and scheduled middle-term gate
  • stop scheduled middle-term memory, Background Life, and memory-compaction LLM work after the existing three-minute activity window expires
  • resume the scheduler automatically when normal game traffic updates the same activity marker
  • keep Player2 health as a consumer of the shared activity session instead of its owner
  • mirror the legacy Player2 option keys and retain compatibility aliases during the rename

The timing and scheduler behavior are unchanged. No schema or configuration migration is required.

Validation

  • PHP lint passed for lib/game_activity.php, lib/player2_health.php, main.php, and service/processors/middleterm/entrypoint.php
  • existing Player2HealthTest: 2 tests, 7 assertions passed
  • focused activity probe: 12 assertions passed for generic state, legacy fallback/mirroring, fresh, stale, and missing activity
  • focused Player2 integration probe passed for generic request activity and session arming
  • focused inactive scheduler probe confirmed return at the generic activity gate before LLM work
  • git diff --check
  • CHIM unstable push guard: PR required for sensitive runtime paths, guarded-author history, and open-PR overlap

Deployment and limits

The original two-file implementation was deployed locally and verified through two inactive scheduler cycles. This naming/ownership refactor adds a new shared module and has not been redeployed, so the local WSL runtime does not yet represent this commit.

Active-game resume and in-game behavior remain untested. Draft PR #690 touches the same scheduler file and draft PR #704 touches main.php; GitHub currently reports this branch as cleanly mergeable, but either PR may require rechecking if its branch changes.

@RANGROO
RANGROO marked this pull request as ready for review August 14, 2026 15:45
@RANGROO
RANGROO marked this pull request as draft August 15, 2026 16:29
@RANGROO
RANGROO marked this pull request as ready for review August 15, 2026 16:31
@RANGROO
RANGROO merged commit 163617b into unstable Aug 15, 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