Host Agent planning in codex app-server

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
Iliyan Malchev
2026-03-19 13:21:53 -07:00
parent c438fc2fb2
commit f1a739e7eb
11 changed files with 447 additions and 190 deletions

View File

@@ -177,7 +177,6 @@ class MainActivity : Activity() {
showToast("Enter a prompt")
return
}
ensureCodexdRunningForAgent()
thread {
val result = runCatching {
val plan = AgentTaskPlanner.plan(
@@ -617,9 +616,9 @@ class MainActivity : Activity() {
val runtimeStatus = latestRuntimeStatus
if (runtimeStatus == null) {
return if (isServiceRunning) {
"Agent runtime: probing codexd..."
"codexd bridge: probing..."
} else {
"Agent runtime: codexd unavailable"
"codexd bridge: unavailable"
}
}
val authSummary = if (runtimeStatus.authenticated) {
@@ -632,7 +631,7 @@ class MainActivity : Activity() {
?.let { ", configured=$it" }
?: ""
val effectiveModel = runtimeStatus.effectiveModel ?: "unknown"
return "Agent runtime: $authSummary, provider=${runtimeStatus.modelProviderId}, effective=$effectiveModel$configuredModelSuffix, clients=${runtimeStatus.clientCount}, base=${runtimeStatus.upstreamBaseUrl}"
return "codexd bridge: $authSummary, provider=${runtimeStatus.modelProviderId}, effective=$effectiveModel$configuredModelSuffix, clients=${runtimeStatus.clientCount}, base=${runtimeStatus.upstreamBaseUrl}"
}
private fun updateAuthUi(
@@ -717,16 +716,6 @@ class MainActivity : Activity() {
}
}
private fun ensureCodexdRunningForAgent() {
val intent = Intent(this, CodexdForegroundService::class.java).apply {
action = CodexdForegroundService.ACTION_START
putExtra(CodexdForegroundService.EXTRA_SOCKET_PATH, defaultSocketPath())
putExtra(CodexdForegroundService.EXTRA_CODEX_HOME, defaultCodexHome())
}
startForegroundService(intent)
isServiceRunning = true
}
private data class AuthStatus(
val authenticated: Boolean,
val accountEmail: String?,