Skip to content

We now support GPT 5.6 - #8

Merged
wty500 merged 1 commit into
masterfrom
support-gpt-5.6
Aug 5, 2026
Merged

We now support GPT 5.6#8
wty500 merged 1 commit into
masterfrom
support-gpt-5.6

Conversation

@wty500

@wty500 wty500 commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Migrates the main framework and the TravelPlanner example from the legacy functions / function_call interface to the modern OpenAI SDK tool-use interface (tools / tool_calls / role:"tool").

All framework logic, prompts and tool schemas are unchanged — only the API layer differs. Dynamic agent generation (add_agent), <talk>-based inter-agent messaging, TODO-driven supervision and the git-backed shared file workspace all behave as before.

What changed

  • llm_core.py (new) — one shared transport that every migrated llm.py delegates to, so the interface exists in a single place:
    • wraps the existing bare tool schemas into the modern {"type":"function","function":{...}} form (a no-parameter tool such as terminate gets the canonical empty object schema),
    • streams every request internally and reassembles one complete response, so a long reasoning turn is never cut off by a response timeout,
    • sends no temperature and never caps max_tokens,
    • repairs stored histories into the strict assistant/tool pairing the new protocol requires (memory windowing and compaction routinely break it).
  • config.pymodel, base_url, and an optional reasoning_effort that is only sent when set.
  • agent.py / llm.py / TravelPlanner main.py — dispatch on tool_calls, return results as role:"tool" with the matching tool_call_id.

Results

TravelPlanner validation set, sole-planning mode, GPT-5.6 with reasoning_effort=xhigh:

Metric GPT-4o GPT-5.6
Delivery Rate 100.0% 100.0%
Commonsense Constraint Micro 81.88% 97.64%
Commonsense Constraint Macro 27.22% 84.44%
Hard Constraint Micro 40.48% 87.14%
Hard Constraint Macro 23.89% 83.33%
Final Pass Rate 10.0% 76.67%

The submission file (merged_plans.jsonl) is included.

Scope

The other examples under examples/ are untouched and still use the legacy interface.

🤖 Generated with Claude Code

Migrate the main framework and the TravelPlanner example from the legacy
functions/function_call interface to the modern OpenAI SDK tool-use
interface (tools / tool_calls / role:"tool"). All framework logic, prompts
and tool schemas are unchanged; only the API layer differs.

- llm_core.py: single shared transport. Wraps bare tool schemas, streams
  every request internally (reassembling one complete response), sends no
  temperature and never caps max_tokens, and repairs stored histories to
  the strict assistant/tool pairing the new protocol requires.
- config.py: model / base_url / optional reasoning_effort.
- TravelPlanner: 76.67% final pass rate on the validation set
  (sole-planning), up from 10.0% with GPT-4o. Submission file included.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

There are a few correctness and reliability issues in the new transport/tooling path (thread-safety in client caching, tool schema wrapping dropping required, cross-platform process cleanup, and an off-by-one headcount cap) that should be fixed before merging.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Pull request overview

This PR migrates the core MegaAgent framework and the TravelPlanner example from the legacy functions / function_call API to the modern OpenAI SDK tool-use protocol (tools / tool_calls / role:"tool"), centralizing the transport logic in a new llm_core.py shared layer.

Changes:

  • Introduces llm_core.py as a shared OpenAI SDK transport (streaming + message sanitation + tool wrapping) and updates the root llm.py to delegate to it.
  • Updates agent/tool execution loops (core agent.py and TravelPlanner main.py) to dispatch on tool_calls and emit role:"tool" results with tool_call_id.
  • Refreshes TravelPlanner benchmark runner ergonomics/logging (execute.py), updates configs to base_url + reasoning_effort, and documents the new interface in README.md.
File summaries
File Description
requirements.txt Adds Python dependencies needed for SDK/http transport and evaluation utilities.
README.md Documents the new tool-use backbone and updates TravelPlanner results presentation.
llm.py Switches root framework LLM calls to delegate through llm_core and updates retry/usage handling.
llm_core.py Adds the shared SDK transport: tool wrapping, message sanitation, internal streaming accumulation.
examples/travel planner/main.py Migrates TravelPlanner runtime loop to tool_calls, adds recruitment guardrails, and hardens history lookup.
examples/travel planner/llm.py Migrates TravelPlanner LLM calls to llm_core and fixes written_files bookkeeping type.
examples/travel planner/execute.py Reworks benchmark runner to add CLI args, timeouts, retries, log archival, and plan validation/salvage.
examples/travel planner/config.py Updates example config to base_url + reasoning_effort and new model name.
config.py Updates root config to base_url + reasoning_effort and new model name.
agent.py Migrates core agent execution loop from function_call to tool_calls and adjusts memory filtering.
.gitignore Ignores benchmark artifacts/logs while preserving the merged submission output.
Review details
  • Files reviewed: 9/12 changed files
  • Comments generated: 5
  • Review effort level: Lite

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

Comment thread llm_core.py
Comment on lines +8 to +31
import json
import logging

import httpx
from openai import OpenAI

_clients = {}


def get_client(api_key, base_url):
key = (api_key, base_url)
if key not in _clients:
_clients[key] = OpenAI(
api_key=api_key,
base_url=base_url,
# Reasoning models can think for a long time, so the read timeout
# is generous — but not unlimited: some gateways occasionally
# accept a request and never answer it, and an unbounded read
# would hang that agent forever. 30 min covers any observed
# xhigh generation with wide margin; the callers' retry loops
# re-issue the request if it ever trips.
timeout=httpx.Timeout(connect=30.0, read=1800.0, write=600.0, pool=30.0),
)
return _clients[key]
Comment thread llm_core.py
Comment on lines +42 to +49
wrapped = []
for t in bare_tools:
fn = {"name": t["name"]}
if "description" in t:
fn["description"] = t["description"]
fn["parameters"] = t.get("parameters", {"type": "object", "properties": {}})
wrapped.append({"type": "function", "function": fn})
return wrapped
Comment on lines +61 to +63
def kill_process_tree(proc):
subprocess.run(['taskkill', '/F', '/T', '/PID', str(proc.pid)],
capture_output=True)
Comment on lines +66 to +67
def run_row(index, row, config_content, timeout):
"""Run main.py for one benchmark row. Returns a status string."""
Comment on lines +192 to +195
with recruit_lock:
if len(employee_dict) > MAX_EMPLOYEES:
result = f"Error: the team already has {MAX_EMPLOYEES} members. No more agents can be recruited."
else:
@wty500
wty500 merged commit c2e45ad into master Aug 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants