tool_context() equivalent: per-conversation store and tool-calling context

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

Maintainers usually reply within 1 day

@AbarnaaSree is already working on this.

Since Sep 9, 2026.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
52/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
python

Research direction

No files or tests are named. Start by locating the tool invocation path and the chat cloning implementation; determine where a contextvars.ContextVar can surround tool calls and where per-chat state belongs. Done means tools can access the current context and mutable chat store, with the store preserved by deep cloning.

Written by the indexing model from the issue text.

Description

ai-triage:done Priority: Low

ellmer recently added tool_context() plus a per-conversation chat$store environment (tidyverse/ellmer#1023, part of tidyverse/ellmer#871). Tools can use it to access per-conversation state without globals, and it survives clone(deep = TRUE).

chatlas has no equivalent: there's no contextvar-based way for a running tool to access the current chat/tool-call context, and no per-chat mutable store.

Possible shape on the Python side: a tool_context() accessor backed by a contextvars.ContextVar set around tool invocation, plus a chat.store dict (or similar) that tools can read/write.

Dominant language
Python
Stars
179
Forks
32
Avg merge
1d 3h
Merged PRs (30d)
10

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

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.

More from posit-dev/chatlas

All issues in posit-dev/chatlas

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.