fix: improve agent classification, retries, and message delivery - #35
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_messagecolumn.Validation
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.