Skip to content

AI media harness for planning, generating, and editing locally

TypeScript

Stop running Claude Code in bare mode so oauth logins work

Bitti02bcc32f4510
diff --git a/docs/architecture.md b/docs/architecture.md
index b948c95..c3ce89c 100644
--- a/docs/architecture.md
+++ b/docs/architecture.md
@@ -23,7 +23,7 @@ The JSON document is versioned and includes project metadata, canvas settings, o
## Agent boundary
-Providers are subprocess adapters with a shared request/event/result contract. Claude Code runs non-interactively with `--bare --print --output-format stream-json`; Codex runs non-interactively with `codex exec --ephemeral --ignore-user-config --json`. PolStudio owns process lifecycle, normalized streaming events, cancellation, session history, and schema validation. Provider output is treated as an untrusted proposal until it validates against the project schema.
+Providers are subprocess adapters with a shared request/event/result contract. Claude Code runs non-interactively with `--print --output-format stream-json` (never `--bare`, which reads neither OAuth nor the keychain and so rejects every subscription login); Codex runs non-interactively with `codex exec --ephemeral --ignore-user-config --json`. PolStudio owns process lifecycle, normalized streaming events, cancellation, session history, and schema validation. Provider output is treated as an untrusted proposal until it validates against the project schema.
An agent can answer, ask the user a question, or propose a full project mutation. Every mutation is applied by PolStudio and persisted atomically; providers never receive authority to write arbitrary files directly.
diff --git a/src-tauri/src/agent.rs b/src-tauri/src/agent.rs
index 3abdb6d..c6e16f2 100644
--- a/src-tauri/src/agent.rs
+++ b/src-tauri/src/agent.rs
@@ -326,7 +326,7 @@ impl AgentProvider for ClaudeProvider {
"claude"
}
fn auth_args(&self) -> &'static [&'static str] {
- &["--bare", "auth", "status"]
+ &["auth", "status"]
}
fn command_spec(
&self,
@@ -337,7 +337,6 @@ impl AgentProvider for ClaudeProvider {
setting: Option<&ProviderSetting>,
) -> Result<CommandSpec, String> {
let mut args = vec![
- "--bare".into(),
"--print".into(),
"--output-format".into(),
"stream-json".into(),
@@ -695,6 +694,10 @@ mod tests {
)
.unwrap();
assert_eq!(claude.current_dir, root.path());
+ // `--bare` refuses OAuth and keychain credentials, so a subscription
+ // login could never run a turn through it.
+ assert!(!claude.args.iter().any(|arg| arg == "--bare"));
+ assert!(claude.args.iter().any(|arg| arg == "--print"));
assert_eq!(
claude
.args
@@ -778,7 +781,9 @@ mod tests {
}
#[test]
- fn claude_readiness_requires_auth_at_the_bare_execution_boundary() {
+ fn claude_readiness_probes_the_oauth_capable_auth_boundary() {
+ // `--bare` never reads OAuth or the keychain, so probing (and running)
+ // through it reported `authRequired` for every subscription login.
let mut probes = Vec::new();
let status = installed_provider_status(
ProviderId::Claude,
@@ -793,21 +798,12 @@ mod tests {
match args {
["--version"] => Ok("Claude Code fixture".into()),
["auth", "status"] => Ok("ordinary session is logged in".into()),
- ["--bare", "auth", "status"] => {
- Err("bare-compatible credentials are missing".into())
- }
_ => Err(format!("unexpected probe: {args:?}")),
}
},
);
- assert_eq!(status.state, "authRequired");
- assert!(status
- .detail
- .contains("bare-compatible credentials are missing"));
- assert_eq!(
- probes,
- vec![vec!["--version"], vec!["--bare", "auth", "status"]]
- );
+ assert_eq!(status.state, "ready");
+ assert_eq!(probes, vec![vec!["--version"], vec!["auth", "status"]]);
}
}
diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs
index 94a3678..4a5df1d 100644
--- a/src-tauri/src/lib.rs
+++ b/src-tauri/src/lib.rs
@@ -1045,7 +1045,10 @@ fn copy_media_file(source: &Path, project_folder: &Path) -> Result<ImportedMedia
/// the result is checked to still sit under the canonical root, so a crafted
/// `..` in a hand-edited pols.json cannot read the rest of the disk.
#[tauri::command]
-fn read_project_file(folder_path: String, relative_path: String) -> Result<tauri::ipc::Response, String> {
+fn read_project_file(
+ folder_path: String,
+ relative_path: String,
+) -> Result<tauri::ipc::Response, String> {
let root = PathBuf::from(folder_path)
.canonicalize()
.map_err(|error| format!("Could not resolve project folder: {error}"))?;