Skip to content

Posit Assistant Responses tool continuation fails with item_reference and prompt cache markers #2645

Closed as not planned

Description

@Liang-Psych

Client or integration

Other

Area

Platform (Windows / macOS / Linux)

Summary

## Bug description

When Posit Assistant uses OpenCodex through the OpenAI Responses endpoint,
the first request can successfully call tools, but the following tool
continuation request may fail with HTTP 502 or an upstream 400.

The issue is reproducible with:

- Client: Posit Assistant 1.2.0
- Proxy: OpenCodex 2.32.1
- Protocol: OpenAI Responses
- Model: `gpt-5.6-luna`
- OpenCodex endpoint: `/v1/responses`
- Provider: ChatGPT Codex forward provider


### Reproduction

1. Run OpenCodex 2.32.1 on the macOS host:
   ocx start --port 7861

2. Connect Positron 2026.08.2 to a remote Linux container using Remote-SSH.
   Posit Assistant runs in the remote container, while port 7861 is forwarded
   to the macOS host.

3. Configure the model as:
   - model: gpt-5.6-luna
   - protocol: openai-responses
   - endpoint: http://127.0.0.1:7861/v1

4. In Posit Assistant, submit a task that requires tool calls, for example:
   "List the files in the workspace and find the relevant R script."

5. The first Responses request succeeds and returns tool calls.

6. After the tool results are returned, the continuation request fails with:
   "Error making request" / "Turn failed"

7. OpenCodex request history reports:
   - status: 502
   - errorCode: upstream_server_error
   - inboundProtocol: responses
   - requestedModel: gpt-5.6-luna

### Version

v2.32.1

### Operating system

macOS host + Linux remote container

### Provider and model

gpt-5.6-luna

### Logs or error output

```shell

Screenshots and supporting files

No response

Redacted configuration

## Expected behavior

The OpenAI Responses compatibility layer should normalize or remove
client-only and non-persisted continuation fields before forwarding to
the ChatGPT Codex backend.

In particular:

- Remove `prompt_cache_breakpoint` recursively from input content parts.
- Remove or resolve `item_reference` items when `store` is `false`.
- Preserve function-call `call_id` pairing.
- Keep the request on the OpenAI Responses protocol.
- Preserve `reasoning.effort`.

## Additional evidence

The first tool-calling request succeeds. The failure happens on the
following continuation request.

After locally applying a compatibility patch that:

1. recursively removes `prompt_cache_breakpoint`;
2. removes `item_reference` when `store=false`;
3. keeps the input array flat;

the exact original failed request replayed successfully with HTTP 200
and returned a complete Responses SSE stream.

## Notes

This appears to be a compatibility gap between third-party Responses
clients such as Posit Assistant and the stricter ChatGPT Codex Responses
backend.

The proxy already contains several related compatibility transforms,
so this may fit naturally into the existing Responses adapter sanitization
pipeline.





I can provide a minimal patch or sanitized request fixture if useful.

Checks

  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, and personal data.

Activity

  1. added
    bug
    on Aug 26, 2026
  2. added
    platform
    on Aug 26, 2026
  3. github-actions commented on Aug 26, 2026

    @github-actions
    Contributor

    Issue closed: insufficient detail

    Thanks for taking the time to submit this issue. It was closed automatically because the structured report is missing information needed to evaluate or reproduce it.

    • Reproduction is empty.
    • Version is missing.
    • Operating system is missing.

    Please edit the issue to add:

    • List the exact steps to reproduce the problem.
    • Add your OpenCodex version so we can reproduce the environment.
    • Add your OS name and version (for example Windows 11 24H2).

    See the Contributing guide for details.

    Once the report passes the automated checks, it will be reopened automatically unless a maintainer has changed its state.

  4. added
    tools
    on Aug 26, 2026
  5. Liang-Psych commented on Aug 26, 2026

    @Liang-Psych
    ContributorAuthor
    1. Start OpenCodex 2.32.1 with ocx start --port 7861.
    2. Connect Positron to a remote Linux container using Remote-SSH.
    3. Configure Posit Assistant to use gpt-5.6-luna through openai-responses.
    4. Submit a task requiring tool calls.
    5. The first request succeeds and returns tool calls.
    6. The following tool continuation fails with Error making request and Turn failed.
    7. OpenCodex reports HTTP 502, upstream_server_error, and inboundProtocol: responses.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugplatformtools

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions