Skip to content

Keep the source link whole when a long answer is clipped - #38

Merged
aryanorastar merged 1 commit into
BasedHardware:mainfrom
singhharsh1708:fix/keep-source-link-when-clipping
Oct 11, 2026
Merged

aryanorastar merged 1 commit into
BasedHardware:mainfrom
singhharsh1708:fix/keep-source-link-when-clipping

Conversation

@singhharsh1708

Copy link
Copy Markdown
Contributor

Customer problem

A long answer loses its source link. presentReviewedAnswer clips the whole reply at 1900 characters and the source line is the last line, so a 1935 character answer ends in Source: https://help.omi.me/en/articles…, a link that opens nothing, and a longer one has no source line at all.

Change

The body is clipped and the closing source line is put back whole, with the shared source labels from supportSteps.js so "Fuente:" and the others are kept too. An answer with no source line, or one that fits, is handled as before. addUnsyncedDataWarning already protects the source line this way for the data-loss warning.

Evidence

AGENTS.md, path 1: a how-to answer comes with the link. The clip only runs on the longest answers, which are the step-by-step ones that most need it.

Verification

  • Added or updated a focused behavior test: two in test/answerPipeline.test.js. The first fails on main; the second keeps short answers and unsourced long answers as they were
  • npm test: 628/628
  • EVAL_NO_MODEL=1 node scripts/customer-eval.js: 8/8
  • Live-model evaluation not needed: the prompt and the model path are unchanged
  • No secrets, customer PII, .env, or railway.toml
  • No new claim that a person was pinged, an issue was filed, or an email was sent without confirmed success

presentReviewedAnswer clipped the whole reply at 1900 characters. The
source line is the last line, so a long answer lost it, or kept it cut
in the middle of the URL: a link that opens nothing. The body is now
clipped and the source line is put back whole, in any of the supported
source labels.
@aryanorastar
aryanorastar merged commit 8b9c31f into BasedHardware:main Oct 11, 2026
3 checks passed
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