Let the command go to Codex or OpenRouter, not only Claude Code

Everything the last commit built assumed one agent was installed, which is a
poor assumption to bake into a dictation tool. So the provider is a setting, and
what it selects is one of three quite different things.

Claude Code and Codex are the same shape: a CLI, streaming JSONL, a session id
to resume, tools that reach the machine and whatever is connected to it. They
share the runner. What differs is spelled out where it differs, which is more
than the flag names: Codex has no system prompt to append, so the instruction
rides in front of the command with a rule between them; it confines its commands
in a sandbox rather than asking about them, so the permission setting is a
sandbox mode; and `-s` is not accepted by `exec resume`, so both settings go
through `-c` overrides, which are.

OpenRouter is the odd one and is meant to be. No tools, no files, no calendar:
it can say what the capital of Peru is and not what is in your diary, and the
settings box says so rather than letting it be discovered. It also has no
session to resume, so the conversation is kept here and resent, capped at 24
messages.

A stored conversation names the provider that made it, and is ignored by any
other: none of them can pick up another's thread, and a stale id would otherwise
fail every command until the timeout cleared it.

The interface calls the thing by its name, which in Turkish means the suffix has
to agree with it: Claude'a but Codex'e, Claude'u but Codex'i. A name dropped
into a sentence through t() cannot be inflected by that sentence, so it arrives
inflected, from a small table in i18n. English takes the name as it is and keeps
the preposition in the sentence.
This commit is contained in:
yusufipk
2026-07-28 17:08:14 +07:00
parent 0206303751
commit 01eea7a363
9 changed files with 527 additions and 179 deletions
+3 -1
View File
@@ -19,6 +19,7 @@ import api
import assistant
import audio
import config as cfg
import i18n
import paste
import vad
from i18n import t
@@ -119,7 +120,8 @@ class Pipeline(QObject):
question = ""
if ask:
question = text
self.stage.emit(t("Asking Claude…"))
self.stage.emit(t("Asking {name}", name=i18n.name(
assistant.display_name(conf), "dative")))
text, denied = assistant.ask(
question, conf,
on_stage=self.stage.emit,