Skip to content

Add persistent and repeatable NPC tasks - #594

Draft
RANGROO wants to merge 8 commits into
unstablefrom
codex/persistent-npc-commitments
Draft

Add persistent and repeatable NPC tasks#594
RANGROO wants to merge 8 commits into
unstablefrom
codex/persistent-npc-commitments

Conversation

@RANGROO

@RANGROO RANGROO commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add persistent NPC tasks for meetings, message delivery, fetch work, escorts, errands, and other future duties
  • expose CreateTasks, ResolveTask, and CancelTask as server actions
  • support one-time and repeating schedules based on in-game hours
  • structure accepted duties through the NPC profile's Formatter LLM in a separate background call, with the Primary LLM as fallback
  • use deterministic request parsing if the formatter is unavailable
  • inject only active tasks into the owning NPC's context
  • show task status and history directly below Middle Term Memory in the CHIM NPC editor
  • show an in-game [CHIM] Task created for <NPC>: <task> notification after persistence succeeds

Runtime behavior

  • the dialogue request queues task creation without blocking the current response
  • the background service formats and persists the task, then queues the in-game confirmation
  • repeating tasks advance from their original schedule anchor when completed or failed
  • missed repeating intervals advance to the next future occurrence
  • cancellation permanently stops recurrence
  • overdue tasks remain active until resolved or cancelled
  • this does not autonomously execute NPC behavior; tasks guide later dialogue, actions, and Background Life context

Validation

  • PHP syntax checks passed for every changed PHP file
  • focused task suite: 12 tests, 56 assertions
  • live PostgreSQL creation and recurrence workflow verified
  • live in-game test created task #7 for Danica Pure-Spring
  • CHIM consumed and processed DebugNotification@Task created for Danica Pure-Spring: Check the town gate
  • merged current unstable; PR reports cleanly mergeable
  • deployed locally; migration completed, npc_commitments exists, Apache is healthy, and changed-file hashes match
  • no DLL, PEX, or ESP artifacts

Scope

  • HerikaServer only
  • no CHIM plugin source change or rebuild is required

@RANGROO RANGROO changed the title Add persistent NPC commitments Add persistent and repeatable NPC tasks Jul 20, 2026
@RANGROO
RANGROO marked this pull request as ready for review July 20, 2026 03:27
…npc-commitments

# Conflicts:
#	lib/data_functions.php
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