Repository navigation
fix: nest dialogue prompt keys and lock each conversation - #342
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
f370b3f to
d249aac
Compare
Handlebars reads speaker.name and player_emotion as nested paths, so the prompt builder stores them with set_path. started_turn and last_turn replace the zeroed clock fields. generate_response holds a per-conversation mutex for the whole update so concurrent calls cannot clobber turn metadata. Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
d249aac to
2a489f5
Compare
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2a489f5a83
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| conversation.metadata.last_turn = conversation.metadata.turn_count as u64; | ||
| conversation.metadata.turn_count += 1; | ||
| conversation.emotional_state = | ||
| self.blend_emotional_states(&conversation.emotional_state, &response.emotional_tone); |
There was a problem hiding this comment.
Delay state mutation until memory persistence succeeds
When RagPipeline::add_memory fails—for example because the embedding client or vector store returns an error—generate_response now returns Err after mutating the mutex-protected conversation in place, so turn_count, last_turn, and the emotional state record a response that the caller was told failed, while success metrics remain unchanged. Before this change, those cloned fields were only written back after memory storage succeeded; move these mutations after the fallible RAG write or roll them back on error.
Useful? React with 👍 / 👎.
Description
Rebased onto
mainc798c9db(#345), which nameslocal_simin the README. That is the closed-vocabulary lint failure ond249aacc.Dialogue prompts use
PromptContext::set_path, sospeaker.nameandplayer_emotion.*nest for Handlebars.started_at/last_activityarestarted_turn/last_turn. Each conversation isArc<Mutex<ActiveConversation>>, held for the wholegenerate_responsestep.The other three failures on
d249aaccare the tracked editor parity red, not this diff:Test (ubuntu, affected)andTest (windows, 2/3)faileditor_engine_render_paritywith the [deferred-failure] editor_engine_render_parity hashes diverge on llvmpipe #273 hashes (034f46c7…vs3cae37d4…). Fix editor/engine parity and the Windows test flakes #340 is the fix.PR Rust checksfails because those test jobs failed. It is not a separate defect.test_async_task_is_finished_lifecycle,test_perception_stress) did not fail on that run.Type of change
Security Considerations
No new dependencies and no new network path.
generate_responsestill uses the injected client and stays off the sim tick.Checklist
Do not merge.