Uh oh!
There was an error while loading. Please reload this page.
fix(learn): relax concept-description output cap 240->400 (self-review hardening after #334) - #337
fix(learn): relax concept-description output cap 240->400 (self-review hardening after #334)#337Jose-Gael-Cruz-Lopez wants to merge 1 commit into
Conversation
ConceptDescription.description capped at 240 chars while the prompt asks for a ~12-28 word sentence. A verbose sentence with long technical terms could overflow 240 -> Flashcards-style schema-validation failure -> agent retry -> UnexpectedModelBehavior -> a user-facing 502 instead of a slightly-long-but-valid description. Raise the ceiling to 400 (still bounded against runaway output) and document why, so it isn't tightened back. No test asserts the cap value. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Deploying with |
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs | frontend-staging | 68e1a69 | Commit Preview URL Branch Preview URL | Jul 15 2026, 04:51 AM |
AndresL230
left a comment
There was a problem hiding this comment.
Approving. Two notes — one clearing up a false alarm, one on the title (which I edited).
The base branch is correct. I flagged staging as suspicious because main is what deploys the staging environment, but that conflated two layers. staging is a legitimate long-lived integration branch that lands in main via promotion PRs (main already carries 426a704 Merge pull request #333 from SaplingLearn/staging). Decisively: backend/agents/concept_describe.pydoes not exist on main — it only exists on staging, having arrived with #334. A PR against main could not modify this file. Nothing is stranded.
The cap change is complete. I checked all four surfaces where a stale bound could hide, and 240 appears in exactly one place in code — the line this PR changes:
- DB:
graph_nodes.descriptionis unboundedTEXT(0001_baseline_schema.sql:41) — no constraint to update. - Persistence: the description is never written server-side.
routes/graph.py:145returns it and the frontend holds it in client-only React state (descCache,Learn.tsx:128). - Frontend: the only
maxLengthinLearn.tsxis120at:1282, on the concept name input, not the description. - Prompt: governs length in words, not chars.
Longer descriptions render fine — the focus card has no line-clamp, but the rail at Learn.tsx:815 is overflowY: auto, so the card grows and the rail scrolls. The new comment is right that this is "a guard, not a display target."
I retitled this. It said "(#334 review follow-up)", which isn't accurate: the only review on #334 (CodeRabbit, on routes/graph.py) asked for input caps and 502 handling, and both were already fixed inside #334 itself by adcd11d before merge. No reviewer ever raised the 240 output cap. This is self-initiated hardening on a different constant in a different file — good change, just not a follow-up. Retitled to "self-review hardening after #334" so nobody goes looking for a review thread that doesn't exist.
Two process notes, neither blocking:
origin/stagingis 11 commits behindmainand 5 ahead. This won't reach the staging environment until astaging→mainpromotion lands — it's queued behind #334's promotion, not stalled on review.- CodeRabbit reports "reviews are disabled for this base branch" on both #334 and this PR. Anything merged via
stagingis getting materially less automated review than work going straight tomain. Worth fixing at the repo level.
Follow-up to the code review of #334 (merged to
staging).ConceptDescription.descriptionwas capped atmax_length=240while the prompt asks for a ~12-28 word sentence. A verbose sentence with long technical terms could overflow 240 → schema-validation failure → agent retry →UnexpectedModelBehavior→ a user-facing 502 instead of a slightly-long-but-valid description.Raises the ceiling to 400 (still bounded against runaway output) and documents why so it isn't tightened back. No test asserts the cap value;
test_graph_concept_description.py5/5 pass.🤖 Generated with Claude Code