Skip to content

Reduce profile and chat loading overhead - #253

Merged
kinqsradio merged 1 commit into
mainfrom
fix/backend-read-latency
Oct 30, 2026
Merged

kinqsradio merged 1 commit into
mainfrom
fix/backend-read-latency

Conversation

@kinqsradio

Copy link
Copy Markdown
Member

Profile loading repeatedly rechecked the same retained source documents through both chat and job dependencies. Reuse distinct canonical source proofs within the existing statement snapshot, after checking job provenance and chat container access. Entry, turn and delivery checks still run, and each request reads current authority.

Chat lists omit search-only SQL for empty searches and take the existing retained-conversation eligibility path before legacy history checks. Displayed titles and individual entries retain their source checks. Recent signed-in requests also avoid a redundant session-touch query while still authenticating against the primary. The agent-facing get_chats read opts out of JIT only for its read-only transaction; the existing provenance fixture now passes instead of timing out during expanded permission-query compilation.

Validation: focused PostgreSQL visibility, profile, chat, provenance and session tests; shared builds, backend build/types, formatting and source review. Complete ordered payloads matched in alternating comparisons, including revocation and cyclic retained sources. A bounded read-only production-data comparison reduced profile helper time from 0.90–1.04s to 0.55–0.60s; the rich retained-chat fixture improved from 2.32s to 1.60s. These samples are not p95 or full-page latency. No persistent permission cache, schema migration or global planning change is introduced.

@kinqsradio
kinqsradio merged commit 86a59f7 into main Oct 30, 2026
1 check passed
@kinqsradio
kinqsradio deleted the fix/backend-read-latency branch November 2, 2026 07:56
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