posit-dev / posit-dev/commons

Consider removing `commons_server()` from API

Open
#171 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
44
Forks
1
Avg merge
1d 7h
Merged PRs (30d)
142

Description

And using shinychat::chat_server() instead.

Currently, commons_server() does 3 things:

  1. Creates a commons_server_start span.
    • Could be removed considering that Shiny already has instrumentation for the session's lifecycle?
  2. Creates a conversation id.
  3. "Pre-warms" the client (i.e., builds the index, etc).
    • We might want to revisit how this works, but regardless, it might be better if this was explicit rather than implicit. Essentially the (recommended) API would change from:
client <- ...
commons_server("chat", client)

to

client <- ...
client$prewarm()
chat_server("chat", client)

I'm not sure if it's possible today, but at least at some point it should be possible to prewarm/cache the index independently of the shiny runtime. In that case, you might not want the pre-warming at all?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the commons_server() entry point and its three responsibilities: the commons_server_start span, conversation ID creation, and client pre-warming. Compare these with shinychat::chat_server() and the proposed client$prewarm() flow. Done means the API direction and treatment of each responsibility are decided, including whether pre-warming remains implicit.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
api
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.