Skip to content

v0.39.0 - Background Chat Streaming and Stop Controls

Choose a tag to compare

@brooksy4503 brooksy4503 released this 08 May 08:30
· 160 commits to main since this release

πŸš€ ChatLima v0.39.0 - Background Chat Streaming and Stop Controls

🎯 What's New

  • Background chat stream consumption β€” chat responses now continue being consumed server-side even if the client disconnects or navigates away mid-generation.
  • Stop generation support β€” users can stop an in-progress chat response using a dedicated stop action.
  • More stable session handling β€” improved auth session retrieval reduces avoidable re-render loops and keeps authenticated chat state steadier.
  • Stream resilience groundwork β€” includes research and implementation planning for more durable chat streaming behaviour.

πŸ”§ Technical Implementation

  • Added lib/chat-stream-consumption.ts to continue consuming stream responses in the background.
  • Added lib/chat-stop-registry.ts to track and cancel active chat generations.
  • Updated app/api/chat/route.ts to integrate background stream consumption and stop handling.
  • Updated components/chat.tsx to support the improved chat generation lifecycle.
  • Improved auth/session helpers in lib/auth-client.ts and lib/context/auth-context.tsx.
  • Added focused coverage for stream consumption and stop registry behaviour:
    • __tests__/api/chat-stream-consumption.test.ts
    • __tests__/lib/chat-stop-registry.test.ts
    • Updated __tests__/components/chat.test.tsx

πŸ›‘οΈ Security & Privacy

  • No new environment variables are required.
  • No database migrations are required.
  • No known privacy-impacting data model changes.
  • Stop handling is scoped to active chat generation control rather than exposing additional user data.

πŸ“ˆ Benefits

For Users

  • Fewer lost or abandoned responses when browser/client state changes during generation.
  • Better control over long-running generations with an explicit stop path.
  • Smoother authenticated chat experience from improved session handling.

For Platform Operators

  • More robust streaming behaviour reduces support friction around interrupted generations.
  • Better test coverage around the chat streaming lifecycle makes future changes safer.

For Developers

  • Clearer separation of concerns for stream consumption and stop/cancel tracking.
  • Dedicated tests document the intended behaviour for resilient streaming and stop controls.
  • Research and planning docs provide a foundation for future stream persistence improvements.

πŸ”„ Migration Notes

No Breaking Changes

This release maintains full backward compatibility. Existing chats, accounts, projects, billing, and model integrations remain unchanged.

User-Facing Changes

  • Users may notice more reliable chat generation behaviour when navigating away or interrupting requests.
  • Users can stop in-progress chat generation through the updated stop action flow.

For Developers

  • No new required environment variables.
  • No database migrations.
  • No dependency updates required for this release.

πŸš€ Deployment

Standard Deployment Process

This release follows the standard ChatLima deployment workflow:

pnpm test:unit
pnpm build
npm version minor -m "chore: release v%s"
git push origin main --tags

Automatic Deployment

With GitHub integration enabled, pushing main automatically triggers production deployment via Vercel.

Pre-Deployment Checklist

  • Unit tests passing: 1414 passed, 20 skipped, 56 passed suites, 1 skipped suite
  • Production build completed successfully
  • Release notes generated and reviewed
  • Version bump and tag prepared for v0.39.0

πŸ“Š Changes Summary

Files Added

  • __tests__/api/chat-stream-consumption.test.ts
  • __tests__/lib/chat-stop-registry.test.ts
  • docs/chat-stream-resilience-research.md
  • docs/plans/2026-05-06-option-1-stream-resilience-plan.md
  • lib/chat-stop-registry.ts
  • lib/chat-stream-consumption.ts

Files Modified

  • app/api/chat/route.ts
  • components/chat.tsx
  • lib/auth-client.ts
  • lib/context/auth-context.tsx
  • __tests__/components/chat.test.tsx
  • codefetch/codebase.md

Commits Included

  • 9b3f02c β€” feat(auth): add getSession method and improve session management
  • 0ecfef2 β€” fix(auth-client): enable default session fetching to prevent re-render loops
  • 45a1f09 β€” feat(chat): implement stop action for chat generation
  • ab4cb71 β€” feat(chat): integrate background stream consumption for chat responses
  • 3399a3d β€” Merge pull request #32 from brooksy4503/plan/option-1-stream-resilience
  • 08580a5 β€” docs: add option 1 stream resilience plan
  • c7cbd86 β€” docs: add chat stream resilience research

Statistics

  • 13 files changed since v0.38.0
  • 121,242 insertions, 60,754 deletions including generated codebase context updates
  • Enhancement: Background Chat Streaming and Stop Controls

Full Changelog: v0.38.0...v0.39.0

πŸŽ‰ What's Next

Future stream resilience work can build on this release by adding deeper persistence/recovery for long-running generations and richer client-side resume behaviour.