fix: improve NPC dialog retry and UI readability#100
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c8787e421d
ℹ️ 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 (@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 (@codex) address that feedback".
| yield return _gateway.Decide(request, value => decision = value, error => decisionError = error); | ||
| } | ||
| finally | ||
| while (HasFreshPendingPlayerChat() && _pendingPlayerChatAttemptCount < PlayerChatMaxModelAttempts) |
There was a problem hiding this comment.
Limit retry loop to player-originated chat stimuli
The new retry loop runs for every pending speech stimulus, but this coroutine is also used for NPC-to-NPC speech (NotifyNearbyNpcSpeech sets fromNpc=true before starting PlayerChatResponseLoop). Because the retry path here does not check _pendingMessageFromNpc, transient DOS.AI failures now cause up to three model calls per NPC-heard line, which can amplify load and consume model budget during outages even though the feature is scoped to direct player chat. Restrict retries to player-originated messages before entering the retry attempts.
Useful? React with 👍 / 👎.
Summary
Local code review
Verdict: APPROVED WITH SUGGESTIONS.
Notes:
Verification
npm.cmd installinbackend/nakamanpm.cmd run buildinbackend/nakamanpm.cmd testinbackend/nakamadotnet build Unity\SecondSpawn.AI.csprojdotnet build Unity\SecondSpawn.UI.csprojdotnet build Unity\SecondSpawn.Networking.csprojvia worktree compiler setupnpx.cmd markdownlint-cli2 ROADMAP.md CHANGELOG.md backend/nakama/README.mdgit diff --checkReview fallback
Codex Cloud and Gemini reviews are best-effort per repo policy. If cloud review quota or connector limits prevent them from running, this PR is ready for merge after green CI plus the local review fallback above.