Skip to content

fixed suggestions bug#66

Merged
KDwevedi merged 4 commits into
amul-devfrom
suggestion_update
May 19, 2026
Merged

fixed suggestions bug#66
KDwevedi merged 4 commits into
amul-devfrom
suggestion_update

Conversation

@yashgoel1331
Copy link
Copy Markdown

Small Promise delay helper for retries to get suggestions from cache.

Copy link
Copy Markdown
Collaborator

@KDwevedi KDwevedi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Core change is good — fetchSuggestionsWithRetry (backoff 300/700/1200/2000ms, early-exit on non-empty) is clean and correctly pairs with backend PR amul-oan-api#64. Two things to fix before merge, both unrelated to the suggestions fix:

🔴 Remove the committed build artifact

tsconfig.tsbuildinfo is a generated TypeScript incremental-build cache, not source. Committing it causes perpetual spurious diffs and merge conflicts. Note PR #65 adds a .gitignore rule for *.tsbuildinfo while this PR commits the file — contradictory. Please gitignore it and drop it from this PR.

🟡 Split out the JWT public-key rotation

public/jwt_public_key.pem is rotated here (2048-bit → ~4096-bit RSA). That's a security-sensitive change that must deploy in lockstep with the backend's signing private key or token verification breaks for all users. It should not ride along in a suggestions bugfix — please move it to its own PR with explicit backend-deploy coordination. (This file is also churning in PR #65; worth reconciling.)

🟢 Non-blocking

Backend GET waits ≤8s and the FE retries 5× on top — worst case a stuck session stalls ~40s. Usually resolves on attempt 1; flagging for later tuning.

Once the artifact and the key rotation are out, the suggestions logic itself is good to merge.

yashgoel1331 and others added 2 commits May 19, 2026 15:37
fetchSuggestionsWithRetry could run its full ~4.2s backoff ladder
(plus a final call) even after the user moved on, and could overwrite
a newer turn's suggestions with stale results.

Pass an isStale() predicate (session changed or assistant typing
again) checked before each attempt and before applying the result, so
the retry tail is bounded to the current turn.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@KDwevedi KDwevedi merged commit afb93d6 into amul-dev May 19, 2026
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