Skip to content

fix(console): correct earlier context_type fix, backend requires a st… - #102

Merged
Lyellr88 merged 2 commits into
MARM-mainfrom
fix/console-memory-context-type-general
Jul 18, 2026
Merged

fix(console): correct earlier context_type fix, backend requires a st…#102
Lyellr88 merged 2 commits into
MARM-mainfrom
fix/console-memory-context-type-general

Conversation

@Lyellr88

@Lyellr88 Lyellr88 commented Jul 18, 2026

Copy link
Copy Markdown
Owner

…ring

Follow-up to my earlier fix in this PR that changed the blank fallback from the stale selectedMemory.context_type to null. That was wrong: an independent review caught that marm-mcp-server's internal endpoint declares context_type as a required non-empty str (min_length=1), and its recall path calls .upper() on it unconditionally -- sending null gets rejected with a 422, it doesn't clear the field. The Console-side correction (restoring the backend's blank-to-'general' coercion) landed separately on fix/console-memory-context-type-null since the branch that originally carried this contract (refactor/console-app-py-split) had already merged.

This commit fixes the actual root cause the CodeRabbit finding was pointing at: the fallback used the memory's previous context_type (stale) instead of a fixed default. The correct fallback is 'general' -- the same default already used for new memories -- not null.

tsc --noEmit clean, npm run build succeeds.

Claude-Session: https://claude.ai/code/session_011s8tBNnQTmb1q5nRAKwhvv

Summary by CodeRabbit

  • Bug Fixes
    • Updated memory editing so clearing the context type consistently saves it as “general” instead of an empty or null value.
    • The selected memory now immediately reflects the default context type after a successful update.

…ring

Follow-up to my earlier fix in this PR that changed the blank fallback
from the stale selectedMemory.context_type to null. That was wrong: an
independent review caught that marm-mcp-server's internal endpoint
declares context_type as a required non-empty str (min_length=1), and
its recall path calls .upper() on it unconditionally -- sending null
gets rejected with a 422, it doesn't clear the field. The Console-side
correction (restoring the backend's blank-to-'general' coercion) landed
separately on fix/console-memory-context-type-null since the branch
that originally carried this contract (refactor/console-app-py-split)
had already merged.

This commit fixes the actual root cause the CodeRabbit finding was
pointing at: the fallback used the memory's previous context_type
(stale) instead of a fixed default. The correct fallback is 'general'
-- the same default already used for new memories -- not null.

tsc --noEmit clean, npm run build succeeds.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011s8tBNnQTmb1q5nRAKwhvv
@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@Lyellr88, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 14 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 581b1084-30de-4800-b44e-c87db6a2738f

📥 Commits

Reviewing files that changed from the base of the PR and between e96c233 and 9761f72.

📒 Files selected for processing (1)
  • marm-console/artifacts/marm-console/src/components/memory/MemoriesTab.tsx
📝 Walkthrough

Walkthrough

MemoriesTab now defaults blank context_type edits to 'general' in both the update payload and the local selected-memory state.

Changes

Memory context type handling

Layer / File(s) Summary
Apply context type fallback
marm-console/artifacts/marm-console/src/components/memory/MemoriesTab.tsx
Blank context types are sent to the update mutation and stored locally as 'general' instead of null.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
marm-console/artifacts/marm-console/src/components/memory/MemoriesTab.tsx (1)

372-372: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Update placeholder to reflect new fallback behavior.

The placeholder explicitly states (blank = null), which contradicts the new logic where a blank field is saved as 'general'. This creates a user-facing correctness bug.

🐛 Proposed fix
-                    <Input placeholder="Context type (blank = null)" value={editContextType} onChange={e => setEditContextType(e.target.value)} className="text-xs" />
+                    <Input placeholder="Context type (blank = 'general')" value={editContextType} onChange={e => setEditContextType(e.target.value)} className="text-xs" />
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@marm-console/artifacts/marm-console/src/components/memory/MemoriesTab.tsx` at
line 372, Update the placeholder on the context-type Input in MemoriesTab so it
states that a blank value is saved as “general,” matching the existing fallback
behavior; leave the value and change-handler logic unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@marm-console/artifacts/marm-console/src/components/memory/MemoriesTab.tsx`:
- Line 372: Update the placeholder on the context-type Input in MemoriesTab so
it states that a blank value is saved as “general,” matching the existing
fallback behavior; leave the value and change-handler logic unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1c68d569-602a-4231-a40e-f883ee214df8

📥 Commits

Reviewing files that changed from the base of the PR and between 8c133ae and e96c233.

📒 Files selected for processing (1)
  • marm-console/artifacts/marm-console/src/components/memory/MemoriesTab.tsx
📜 Review details
⏰ Context from checks skipped due to timeout. (3)
  • GitHub Check: Analyze (actions)
  • GitHub Check: Analyze (python)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (1)
marm-console/artifacts/marm-console/src/components/memory/MemoriesTab.tsx (1)

150-173: LGTM!

CodeRabbit follow-up. The placeholder still said 'blank = null' after
the earlier fix changed a cleared context type to fall back to
'general' instead. Copy-only change, no logic touched.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011s8tBNnQTmb1q5nRAKwhvv
@Lyellr88
Lyellr88 merged commit 343184e into MARM-main Jul 18, 2026
7 checks passed
@Lyellr88
Lyellr88 deleted the fix/console-memory-context-type-general branch July 18, 2026 12:16
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.

2 participants