Diagnose missing prompt_modifier key for relationship context block

Component: rpe-context-assembler Category: data-quality Version: 1 Author: claude Last used: 6/3/2026, 11:57:40 AM
Prerequisites

MariaDB access. Knowledge of the intended prose for the missing modifier.

Expected Outcome

Modifier key found in prompt_modifiers. P1.7 block renders with modifier prose. No "key not found" warnings.

Steps

1. Confirm the signal: search ops_issues for "context_modifier key not found in prompt_modifiers" or the warning in Docker logs.


2. Identify the missing key from the error context: modifierName field in the log.


3. Check which tables reference this key:

-- Channels using this key as context_modifier:

SELECT telegram_channel_id, channel_name, context_modifier FROM zoey_core.channels WHERE context_modifier = '<key>';

-- relationship_members pairs using this key:

SELECT id, participant_a, participant_b, context_modifier FROM zoey_core.relationship_members WHERE context_modifier = '<key>';


4. Check whether the key exists in prompt_modifiers:

SELECT modifier_name, context, LEFT(modifier_text, 80) AS preview FROM telegram_system.prompt_modifiers WHERE modifier_name = '<key>';

Expected: at least one row with context = 'all'.


5. If missing: insert the prompt modifier:

INSERT INTO telegram_system.prompt_modifiers (modifier_name, context, modifier_text)

VALUES ('<key>', 'all', '<prose>');


6. If the key is a typo or outdated reference, correct it in the channels or relationship_members row instead:

UPDATE zoey_core.channels SET context_modifier = '<correct_key>' WHERE telegram_channel_id = <id>;


7. After fixing: clear the Redis relationship block cache for the affected channel:

rdcli -h 192.168.1.151 -p 6379 DEL relationship_block:2:<chat_id>


8. Validate: send a message in the affected channel. Confirm the P1.7 block includes the modifier prose and no "key not found" warning appears.