Skip to content

fix: improve agent classification, retries, and message delivery - #35

Merged
devhims merged 2 commits into
mainfrom
fix/agent-classification-retries
Sep 11, 2026
Merged

fix: improve agent classification, retries, and message delivery#35
devhims merged 2 commits into
mainfrom
fix/agent-classification-retries

Conversation

@devhims

@devhims devhims commented Sep 11, 2026

Copy link
Copy Markdown
Owner

Classification could fail before research started because Fireworks GLM returned incomplete arguments when forced to call classify_request. A subsequent “try again” also lost the original request because failed turns are excluded from completed conversation memory.

This change uses automatic tool selection while requiring exactly one validated classification call before proceeding. Invalid or missing calls receive one repair attempt within the original 20-second deadline, with separate usage accounting, persisted validation diagnostics, and a readable terminal error if repair fails.

The dashboard now renders user messages immediately using React useOptimistic for new sessions and follow-ups. Confirmed admission reconciles the temporary message without duplication. Failed delivery shows an accessible alert and restores the exact draft; ambiguous retries reuse the same idempotency key. Admitted message previews bridge navigation while history loads.

Bare retries now snapshot the failed request's execution message and preserve its original parent. The displayed user message stays unchanged. Resolution is scoped to the account, session, and branch, supports legacy retry chains, and preserves the effective request in subsequent completed conversation memory. An idempotent SQLite migration adds a nullable execution_message column.

Validation

  • Platform TypeScript and production Next.js webpack builds pass.
  • 31 web unit tests and 16 Chrome dashboard checks pass, including delayed delivery, draft restoration, duplicate prevention, and slow-history navigation.
  • 58 focused router, deadline, and conversation-memory tests pass.
  • 21 local Workers Durable Object integration tests pass.
  • Offline replay of the captured provider failure succeeds after a valid repair through the actual provider adapter and SDK.
  • A live Fireworks response missing its clarification question was repaired successfully within 6.3 seconds.

Live classification of the original comparison returned valid output in 2.8 seconds, but GLM still requested clarification rather than selecting topic research. This fixes the reproduced validation failure and retry-context loss; routing quality remains a separate limitation. No full research replay or production deployment was performed.

Test captures and reports remain local and are not included in this PR. No dependency or lockfile changes.

@vercel

vercel Bot commented Sep 11, 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 11, 2026 1:44pm UTC

@devhims devhims changed the title fix: repair classification and preserve failed request context fix: improve agent classification, retries, and message delivery Sep 11, 2026
@devhims
devhims merged commit a49811b into main Sep 11, 2026
6 checks passed
@devhims
devhims deleted the fix/agent-classification-retries branch September 11, 2026 13:48
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