fix(webui): restore Codex title generation and diagnose API failures (#5952)

* fix(webui): restore Codex title generation and diagnose API failures

* refactor(logging): keep title diagnostics out of provider contracts

* fix(webui): defer title reasoning to model defaults

* refactor(webui): inline default title reasoning argument
This commit is contained in:
chengyongru authored and GitHub committed 2026-09-28 14:50:21 +08:00
1 parent 66d48fcb7f
commit 5294dc2e3f
5 files changed
+253 -9

No files matched your search

+5 -3
View File
@@ -64,7 +64,6 @@ WEBUI_TITLE_METADATA_KEY = "title"
WEBUI_TITLE_USER_EDITED_METADATA_KEY = "title_user_edited"
TITLE_MAX_CHARS = 60
TITLE_GENERATION_MAX_TOKENS = 96
TITLE_GENERATION_REASONING_EFFORT = "none"
# Latest active turn projection per ``chat_id`` (websocket only). It survives browser refresh
# while the gateway process stays up and is implicitly dropped on restart.
@@ -256,7 +255,10 @@ async def maybe_generate_webui_title(
prompt += f"\nAssistant: {truncate_text(assistant_text, 1_000)}"
try:
with llm_usage_source("system"):
with (
llm_usage_source("system"),
logger.contextualize(purpose="webui_title", session_key=target_session.key),
):
response = await provider.chat_stream_with_retry(
[
{
@@ -272,7 +274,7 @@ async def maybe_generate_webui_title(
model=model,
max_tokens=TITLE_GENERATION_MAX_TOKENS,
temperature=0.2,
reasoning_effort=TITLE_GENERATION_REASONING_EFFORT,
reasoning_effort=None,
retry_mode="standard",
)
except Exception: