Skip to content

Remove dead capability prompt-context assignments - #4997

Merged
SpicyMarinara merged 1 commit into
stagingfrom
agent/4996-capability-context-quality
Aug 14, 2026
Merged

SpicyMarinara merged 1 commit into
stagingfrom
agent/4996-capability-context-quality

Conversation

@SpicyMarinara

@SpicyMarinara SpicyMarinara commented Aug 14, 2026 •

Copy link
Copy Markdown
Collaborator

Important

Contributions target staging. Only SpicyMarinara may promote this repository staging branch or a same-repository hotfix/* branch to main.

Linked issue

Closes #4996

Why this change

GitHub native Code Quality identified an always-overwritten initial capability prompt-context value and an unused non-game assignment. The cleanup preserves the context-injection side effects and game capability-provider behavior while clearing both release-quality findings.

What changed

  • Scope the collected prompt-context result to the game branch, where buildGmFormatReminder consumes its provides map.
  • Keep non-game context and roleplay-event injection awaited for side effects without storing its unused return value.
  • Remove the default result that every chat-mode path overwrote before use.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

Automated proof on exact head 667d3aba6f48ada359b5a30bf0474937a68884ef:

  • pnpm check passed (Impeccable context, localization, workspace lint/type checks, and production builds).
  • pnpm --filter @marinara-engine/server lint passed.
  • pnpm --filter @marinara-engine/server exec tsx ../../scripts/regressions/capability-package-lifecycle.regression.ts passed; its intentional failure-fixture logs were emitted as expected.
  • The final diff changes only result binding: both conditional await injectCapabilityContexts(...) calls, their arguments, call order, injected message mutation, roleplay-event collection, and the game .provides consumer remain intact.

No browser or container pass was run because this patch is a mechanical TypeScript scoping cleanup with no runtime branch, output, UI, or built artifact contract change.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened
  • Version/release files updated (only if this PR includes a version bump)

No docs, localization, version, or changelog changes are needed because behavior and user-visible output are unchanged.

UI evidence (if applicable)

Not applicable; no UI changes.

Summary by CodeRabbit

  • Refactor
    • Improved internal handling of capability context during generation.
    • No user-visible behavior changes.

@coderabbitai

coderabbitai Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: ebae3617-6557-406f-9c46-6a4018199ff4

📥 Commits

Reviewing files that changed from the base of the PR and between 4d74964 and 667d3ab.

📒 Files selected for processing (1)
  • packages/server/src/routes/generate.routes.ts

📝 Walkthrough

Walkthrough

The generation route removes the outer capabilityPromptContext declaration and creates branch-local constants at the game and non-game capability-context injection sites.

Changes

Capability context cleanup

Layer / File(s) Summary
Scope capability context at injection sites
packages/server/src/routes/generate.routes.ts
Removes the outer context initialization. The game branch retains the returned context for the game format reminder. The non-game branch declares its injected context locally.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to 667d3

This change removes unused capability-context assignments without changing context injection or user-visible behavior. No actionable merge-blocking risk remains beyond normal checks and review.

Possibly related PRs

Suggested reviewers: thetopham, gunterlie, kolacheee

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the removal of dead capability prompt-context assignments.
Description check ✅ Passed The description includes the linked issue, rationale, changes, validation results, and documentation and UI impact.
Linked Issues check ✅ Passed The changes satisfy issue #4996 by removing both dead assignments while preserving required context injection and game-path behavior.
Out of Scope Changes check ✅ Passed The changes are limited to the requested TypeScript scoping cleanup and include no unrelated code, UI, documentation, or release changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/4996-capability-context-quality

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@SpicyMarinara
SpicyMarinara force-pushed the agent/4996-capability-context-quality branch from 52b761f to 667d3ab Compare August 14, 2026 02:46
@SpicyMarinara
SpicyMarinara marked this pull request as ready for review August 14, 2026 02:46
@SpicyMarinara
SpicyMarinara merged commit 2f9e2b0 into staging Aug 14, 2026
22 of 28 checks passed
@SpicyMarinara
SpicyMarinara deleted the agent/4996-capability-context-quality branch August 14, 2026 02:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant