Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

fix(workbench): round-19 Codex P2 — auth-failure notify (Codex/OpenCode startup) + clear stale effort on model change

cyh11ec43dd9fac
diff --git a/modules/agents/codex/agent.py b/modules/agents/codex/agent.py
index fa9d5670a..5675c0476 100644
--- a/modules/agents/codex/agent.py
+++ b/modules/agents/codex/agent.py
@@ -190,6 +190,19 @@ class CodexAgent(BaseAgent):
"notify",
error_text,
)
+ else:
+ # The reset-OAuth prompt went out over the IM client
+ # (``send_message_with_buttons``) but isn't a durable ``messages``
+ # row, and the web Chat renders only durable rows — so persist a
+ # terminal notify here too, or an expired Codex login stops the
+ # prompt with no on-screen explanation (Codex P2). The not-handled
+ # branch already persists via ``emit_agent_message``.
+ try:
+ from core.message_mirror import persist_agent_message
+
+ persist_agent_message(request.context, "notify", error_text)
+ except Exception:
+ logger.debug("codex: failed to persist auth-recovery notify", exc_info=True)
await self._remove_ack_reaction(request)
# The turn never started (all retries failed) — release the
# web-Chat working/Stop state instead of leaving it until the
diff --git a/modules/agents/opencode/agent.py b/modules/agents/opencode/agent.py
index cfcf6d6ae..30176f391 100644
--- a/modules/agents/opencode/agent.py
+++ b/modules/agents/opencode/agent.py
@@ -352,6 +352,19 @@ class OpenCodeAgent(OpenCodeMessageProcessorMixin, BaseAgent):
"notify",
message,
)
+ else:
+ # The reset-OAuth prompt went out over the IM client
+ # (``send_message_with_buttons``) but isn't a durable ``messages``
+ # row, and the web Chat renders only durable rows — so persist a
+ # terminal notify here too, or an expired OpenCode/provider login
+ # ends the turn with no on-screen explanation (Codex P2). The
+ # not-handled branch already persists via ``emit_agent_message``.
+ try:
+ from core.message_mirror import persist_agent_message
+
+ persist_agent_message(request.context, "notify", message)
+ except Exception:
+ logger.debug("opencode: failed to persist auth-recovery notify", exc_info=True)
finally:
if run_registered:
await server.mark_run_inactive(session_id)
diff --git a/ui/src/components/workbench/ChatPage.tsx b/ui/src/components/workbench/ChatPage.tsx
index 21c02d9ed..e565ed94d 100644
--- a/ui/src/components/workbench/ChatPage.tsx
+++ b/ui/src/components/workbench/ChatPage.tsx
@@ -1108,7 +1108,22 @@ const AgentRoutePicker: React.FC<AgentRoutePickerProps> = ({ session, agents, on
key={model}
active={model === currentModel}
disabled={patching}
- onClick={() => void applyPatch({ model })}
+ onClick={() => {
+ const patch: Partial<WorkbenchSession> = { model };
+ // Switching to a Claude model whose effort set no longer includes
+ // the current effort (e.g. xhigh/max → a model without them):
+ // clear it in the SAME patch. Otherwise the header keeps showing
+ // /storing an effort the new model can't run — the backend drops
+ // it via normalize_claude_reasoning_effort, so the displayed route
+ // wouldn't match what actually dispatches (Codex P2).
+ if (backend === 'claude' && currentEffort) {
+ const opts = claudeReasoning[model];
+ if (opts && !opts.some((o) => o.value === currentEffort)) {
+ patch.reasoning_effort = null;
+ }
+ }
+ void applyPatch(patch);
+ }}
>
<span className="flex-1 truncate font-mono text-[11px]">{model}</span>
</RouteItem>