reasoning-replay=keep-last mandatory with pi/gpt-oss-20b but lead to request crash

Open
#151 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
python
Domain
backend

Research direction

The traceback points to _merge_consecutive in forge/clients/llamafile.py (around line 250), called from _send_native; it fails when a message's content is a list and gets concatenated with a string. Start by reproducing with the keep-last reasoning-replay setting and a gpt-oss-20b style message history, then check what shape content takes at that point. Done means the merge handles list content without a TypeError and a regression test covers it.

Written by the indexing model from the issue text.

Description

pi/qwen3.6-35b-a3b loses reasoning without reasoning-replay=keep-last, but its use leads to an internal forge crash:

Error: "can only concatenate list (not \"str\") to list"

Forge version: 0.9.3 (standalone installer)
Backend: --backend openai
Model: gpt-oss-20b
Harness: pi v0.84.2
Flags: --serialize --reasoning-replay keep-last

Traceback

File "forge/clients/llamafile.py", line 736, in _send_native
      merged = _merge_consecutive(messages)
File "forge/clients/llamafile.py", line 250, in _merge_consecutive
      "content": target.get("content", "") + "\n\n" + m.get("content", ""),
TypeError: can only concatenate list (not "str") to list

Assisted by Claude Sonnet 5

Dominant language
Python
Stars
2.3k
Forks
174
Avg merge
7h 44m
Merged PRs (30d)
8

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 antoinezambelli/forge

All issues in antoinezambelli/forge

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.