Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Pi: add session-affinity headers and sanitized prompt-cache diagnostics

Open
#331 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
python
Domain
ai, api, backend

Research direction

No implementation files, tests, or entry points are named in the issue. Start by locating Pi's production request construction and any existing diagnostic tooling, then trace saved-state handling; done means affinity behavior is enabled safely, opt-in diagnostics cover the listed retention modes without exposing bearer tokens, malformed state fails cleanly, and the measured evidence is preserved without asserting a retention guarantee.

Written by the indexing model from the issue text.

Description

Problem

Pi sessions can be routed across multiple AI Gateway destinations when traffic splitting is configured. Prompt caches are destination-local, so a conversation needs session-affinity headers to avoid avoidable cache misses.

Cache-retention investigations also need reproducible, sanitized tooling. Current observations do not prove that GPT subagents have short retention: GPT-5.6 Sol rejects explicit in_memory, and observed expiry may be caused by UAG forwarding, backend eviction, or prefix matching.

Expected behavior

  • Enable Pi's production-safe session-affinity compatibility behavior.
  • Add opt-in diagnostic scripts that send stable prompt-cache prefixes and report cache usage without printing bearer tokens.
  • Cover 24h, provider-default, and explicit in_memory request construction.
  • Validate phase-separated saved state and fail cleanly on malformed state.
  • Preserve the measured 45/50/60-minute evidence without claiming a backend retention guarantee.
  • Do not force PI_CACHE_RETENTION or install a child/subagent short-cache policy.
Dominant language
Python
Stars
97
Forks
75
Avg merge
1d 9h
Merged PRs (30d)
205

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.

More from databricks/unity-gateway

All issues in databricks/unity-gateway

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.