Skip to content

Preserve user facts and constraints when rewriting search queries - #99

Merged
devhims merged 2 commits into
mainfrom
fix/agent-query-and-transcript-latency
Sep 27, 2026
Merged

devhims merged 2 commits into
mainfrom
fix/agent-query-and-transcript-latency

Conversation

@devhims

@devhims devhims commented Sep 27, 2026 •

Copy link
Copy Markdown
Owner

Problem / Motivation

A request about Opus 5.5 was rewritten to a search for Opus 4.5. The classifier response passed structural validation, so discovery researched the wrong version. The final answer then treated that mismatched evidence as a reason to correct the user's request.

What changed

Make faithful search rewriting the primary classifier instruction. Preserve names, versions, dates, quantities, units, budgets, comparison subjects and exclusions. Remove filler without changing facts or inventing qualifiers. The prompt includes examples and requires comparing the proposed query with the request before submission. Validation for dotted numeric constraints remains a secondary safeguard. A changed, omitted or invented number triggers the existing repair attempt. If repair still fails, the run stops before searching the wrong subject.

Comparisons may retain versions supplied in earlier user messages. Requests without explicit dotted numbers keep their existing behavior. This check does not depend on a product release catalog.

Tests

The captured rewrite failed a regression test before the fix. The full platform and container suites passed, followed by 56 focused router tests and a final type check. Cases cover substitution, omission, added versions, valid refinements, version prefixes, punctuation and follow-up comparisons.

All 11 live classifier checks passed using the configured Fireworks GLM model. The four fact-preservation cases passed on their first attempt, covering Opus 5.5, model size and RAM with no GPU, meal time/calorie limits, and camera model/year/exclusions.

The reported 18.637-second transcript call was also inspected. Extraction and retry gaps took 13.170 seconds; surrounding application work took 5.467 seconds. The longest successful proxy attempt took 10.735 seconds. This PR does not change transcript transport or claim to fix that latency. No production deployment was performed.

@vercel

vercel Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
video2ctx-web Ready Ready Preview Sep 27, 2026 7:40am UTC

@devhims devhims changed the title Preserve user-supplied versions in agent search queries Preserve user facts and constraints when rewriting search queries Sep 27, 2026
@devhims
devhims merged commit 16de902 into main Sep 27, 2026
10 checks passed
@devhims
devhims deleted the fix/agent-query-and-transcript-latency branch September 27, 2026 08:25

This branch was successfully deployed

1 active deployment
Preview — d9b34a85 Deployed Sep 27, 2026 by vercel[bot]
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.

1 participant