﻿# LangChain Codex caching changes how system and per-call instructions combine

The Codex adapter changes the system-message encoding and adds session identity. Check prompt semantics and cache usage independently.

Author: Retrivium editorial team
Updated: 2026-11-20
Canonical URL: https://retrivium.ai/journal/daily-20261120-agent-langchain-codex-system-instructions-cache/
Language: en

The November 19, 2026 release of langchain-openai 1.8.3 includes a caching fix for the Codex adapter on GPT-6.2. The merged change moves the system prompt to the first developer message and sends a session identifier. The maintainer also describes a change in composition: per-call instructions add to the system prompt where the previous path could replace it. That behavioral change deserves a compatibility test even when cache usage improves.

## Inspect instruction order at the adapter boundary

In a development environment you control, record the structure of a request without retaining production prompts. A harmless shape fixture can ask for a brief answer in a particular format and add a different per-call preference. Inspect the position and role of the stable instruction, then verify the one-off instruction appears where the new contract expects. Use the same fixture before and after the library update.

## Check isolation as well as reuse

Compare normal repeated calls within a session and calls from an independent session. A repeated prompt can test intended reuse and a distinct session can check that the application assigns its identifiers correctly. Use separate test identities when the deployment normally isolates tenants or projects. A cache metric alone gives little information about whether your application associated a request with the right conversation.

## Interpret a cache miss in context

Track cached usage where the route exposes it and hold the leading instruction stable during the repeated part of the experiment. Record changes to the model, system instruction and session identity. The patch addresses adapter behavior. A changed prompt, an unavailable usage field or provider cache conditions can still affect what an operator observes.

## Check the migration contract

Expect the per-call text to supplement the baseline on the updated route. Inspect callers that relied on replacement and make their baseline explicit where needed. Keep separate release criteria for instruction behavior and cache economics, so an improvement in one cannot hide a regression in the other.

## Sources

- [LangChain release notes](https://github.com/langchain-ai/langchain/releases/tag/langchain-openai==1.8.3)
- [Merged adapter change](https://github.com/langchain-ai/langchain/pull/41949)

## Related reading

- [Prompt cache working sets](/journal/frontier-infrastructure-prompt-cache-working-set/)
- [Cache expiration](/journal/week46-agent-litellm-cache-expiry-index/)
