Use server authentication for explicit remote session commands (#49624)

## Why

Session commands with `--remote` should use the selected server's authentication and execution environment, even when the caller has workload identity configured and cannot read its identity token.

## What changed

Connect `queue`, `archive`, `unarchive`, and `delete` directly to the explicit remote app server after validating configuration. Skip caller credential and runtime initialization, use remote thread parameters, and preserve the caller's working-directory override.

## Testing

Add end-to-end coverage with an unreadable caller identity token to verify queued turns use the server's API key and remote archive, unarchive, and deletion operate on the selected server. Add configuration-validation coverage for all four commands and `--no-daemon` rejection coverage for remote unarchive and delete.

GitOrigin-RevId: 5da7abbb40506cd754a8863e1a9d8fad9b1f09a9
This commit is contained in:
cooper-oai
2026-09-30 13:16:08 +00:00
committed by copyberry
parent 92bc601ad6
commit 7219fd735b
5 changed files with 316 additions and 2 deletions
+2
View File
@@ -363,6 +363,8 @@ fn no_daemon_rejects_agents_and_explicit_remote_targets() -> Result<()> {
"--no-daemon --remote ws://localhost:9999 agents",
"--no-daemon --remote ws://localhost:9999",
"--no-daemon --remote ws://localhost:9999 archive example",
"--no-daemon --remote ws://localhost:9999 unarchive example",
"--no-daemon --remote ws://localhost:9999 delete --force 123e4567-e89b-12d3-a456-426614174000",
"--no-daemon --remote ws://localhost:9999 queue --thread example --message hello",
"--remote ws://localhost:9999 resume --no-daemon --last",
"--no-daemon fork --remote ws://localhost:9999 session-name",