Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions acp_adapter/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -1623,6 +1623,13 @@ def _notify_title_update(_title: str) -> None:
user_text,
final_response,
state.history,
main_runtime={
"model": getattr(state.agent, "model", None),
"provider": getattr(state.agent, "provider", None),
"base_url": getattr(state.agent, "base_url", None),
"api_key": getattr(state.agent, "api_key", None),
"api_mode": getattr(state.agent, "api_mode", None),
},
title_callback=_notify_title_update,
)
except Exception:
Expand Down
1 change: 1 addition & 0 deletions scripts/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@
"dirtyren@users.noreply.github.com": "dirtyren",
"s96919@gmail.com": "s96919",
"rasitakyol@hotmail.com": "rasitakyol",
"141703117+seagpt@users.noreply.github.com": "seagpt",
"yakimenkoleksander228@gmail.com": "doxe0x",
"a54983334@163.com": "Code-suphub",
"78542984+Code-suphub@users.noreply.github.com": "Code-suphub",
Expand Down
12 changes: 12 additions & 0 deletions tests/acp/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -1323,6 +1323,11 @@ def mock_run(*args, **kwargs):
async def test_prompt_auto_titles_session(self, agent):
new_resp = await agent.new_session(cwd=".")
state = agent.session_manager.get_session(new_resp.session_id)
state.agent.model = "gpt-5.6-sol"
state.agent.provider = "openai-codex"
state.agent.base_url = "https://chatgpt.example.test/backend-api/codex"
state.agent.api_key = object()
state.agent.api_mode = "codex_responses"
state.agent.run_conversation = MagicMock(return_value={
"final_response": "Here is the fix.",
"messages": [
Expand All @@ -1343,6 +1348,13 @@ async def test_prompt_auto_titles_session(self, agent):
assert mock_title.call_args.args[1] == new_resp.session_id
assert mock_title.call_args.args[2] == "fix the broken ACP history"
assert mock_title.call_args.args[3] == "Here is the fix."
assert mock_title.call_args.kwargs["main_runtime"] == {
"model": "gpt-5.6-sol",
"provider": "openai-codex",
"base_url": "https://chatgpt.example.test/backend-api/codex",
"api_key": state.agent.api_key,
"api_mode": "codex_responses",
}
assert callable(mock_title.call_args.kwargs["title_callback"])

@pytest.mark.asyncio
Expand Down
13 changes: 13 additions & 0 deletions tests/test_tui_gateway_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -7457,6 +7457,12 @@ def test_prompt_submit_auto_titles_session_on_complete(monkeypatch):
"""maybe_auto_title is called after a successful (complete) prompt."""

class _Agent:
model = "gpt-5.6-sol"
provider = "openai-codex"
base_url = "https://chatgpt.example.test/backend-api/codex"
api_key = object()
api_mode = "codex_responses"

def run_conversation(
self, prompt, conversation_history=None, stream_callback=None
):
Expand Down Expand Up @@ -7489,6 +7495,13 @@ def run_conversation(
assert args[1] == "session-key"
assert args[2] == "Tell me about Rome"
assert args[3] == "Rome was founded in 753 BC."
assert mock_title.call_args.kwargs["main_runtime"] == {
"model": "gpt-5.6-sol",
"provider": "openai-codex",
"base_url": "https://chatgpt.example.test/backend-api/codex",
"api_key": _Agent.api_key,
"api_mode": "codex_responses",
}


def test_prompt_submit_skips_auto_title_when_interrupted(monkeypatch):
Expand Down
11 changes: 11 additions & 0 deletions tui_gateway/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -9684,6 +9684,17 @@ def _stream(delta):
text,
raw,
session.get("history", []),
# Keep auxiliary auto-detection aligned with the active
# Desktop/Webapp session. Without this, providers that
# rely on runtime auth (for example OpenAI Codex OAuth)
# are skipped and the new session remains untitled.
main_runtime={
"model": getattr(agent, "model", None),
"provider": getattr(agent, "provider", None),
"base_url": getattr(agent, "base_url", None),
"api_key": getattr(agent, "api_key", None),
"api_mode": getattr(agent, "api_mode", None),
},
# Push the generated title live so the sidebar renames
# without waiting for the next list refresh (the titler
# runs async, after this turn's refresh already fired).
Expand Down
Loading