Skip to content

Run relationship worker only for queued work - #89

Draft
RANGROO wants to merge 1 commit into
unstablefrom
codex/relationship-worker-on-demand
Draft

Run relationship worker only for queued work#89
RANGROO wants to merge 1 commit into
unstablefrom
codex/relationship-worker-on-demand

Conversation

@RANGROO

@RANGROO RANGROO commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • remove relationship-worker startup checks from foreground prompt construction
  • start the detached worker only after an evaluation or NPC initialization is successfully queued
  • apply RELATIONSHIP_UPDATE_CHANCE before listener and database context work
  • reuse the relationship map already loaded for prompt filtering
  • remove per-iteration idle trace writes while preserving Dialectic's initialization queue

Why

context_pre.php checked or launched the worker on every relationship-enabled prompt. The daemon also appended two raw trace lines every two seconds while idle, and prompt context could read the same relationship map twice.

Dialectic compatibility

  • keeps _relProcessInitQueue(5) in every worker batch
  • starts the worker for both evaluation and initialization jobs
  • no schema migration, version bump, client change, or relationship-data conversion change
  • adapts the foreground efficiency work from HerikaServer PR #725 without copying its retired-initialization removal

Validation

  • PHP lint passed for all five changed PHP files
  • focused PHPUnit: 12 tests, 56 assertions
  • git diff --check
  • deployed source/runtime SHA-256 hashes match for all four runtime files
  • deployed runtime PHP lint passed for all four runtime files
  • clean prompt-context probe: 0.862 ms, no PID file, and no worker process
  • on-demand worker-start probe with empty queues: 18.974 ms
  • idle worker log growth: 0 bytes over five seconds
  • DialecticServer deployment health returned HTTP 200
  • Apache write access passed for preserved voice and PipVision capture directories

Performance

The prompt hot path no longer performs process/PID checks and now reads relationship state once. The worker no longer writes roughly 3,600 idle trace lines per hour. The reviewable diff is 296 changed lines across five files; most of the movement relocates the existing cross-platform launcher from prompt context to the queue.

Local deployment

Deployed exact commit 10224efb6b2d6528dca88fc736e54f3e520ca6b0 from the feature worktree to DwemerAI4Skyrim3:/var/www/html/DialecticServer. Configuration, logs, caches, backups, uploads, databases, voice samples, and the unchanged game client were preserved.

Limits

  • no in-game conversation was run
  • no live Relationship LLM evaluation or real initialization job was submitted; both queues were confirmed empty before the worker-start probe

@RANGROO
RANGROO marked this pull request as ready for review August 24, 2026 06:55
@RANGROO
RANGROO marked this pull request as draft August 24, 2026 06:56
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