Skip to content

Headless/council run durability + idle-endpoint mismatch + RAG scope loss #14

Description

@ExtraToast

Filed from the agent-kit council integration review (read-only research council, 2026-07-03) — these repos are tightly coupled with agent-kit's fanout/supervise runner and knowledge loop.

1. Headless jobs launched but never durably reconciled

StartHeadlessJobCommandHandler.kt starts a gateway job + saves a RUNNING WorkspaceAgentSession, but pollHeadlessJob (AgentGatewayClient.kt) has no production caller. Gateway state is in-memory and output /tmp-backed (agent-runtime HeadlessJobManager.kt). Council/headless runs have no durable status/output source of truth.
Action: durable headless-run table + poll/reconcile worker + persisted output refs; drive terminal session status from it.

2. Headless job id stored as gatewayAgentId, idle checks hit the interactive endpoint

Stored in gatewayAgentId (StartHeadlessJobCommandHandler.kt); IdleScaleDownScheduler.ktgateway.agentIdle/agents/{id} (interactive-only). Headless state is at /agents/headless/{id} (HeadlessController.kt).
Action: split interactiveGatewayAgentId from headlessJobId; branch idle/recycle by runMode.

3. Scope loss through the knowledge RAG adapter

KnowledgeMcpTransport.kt recall passes only query/limit/mode, dropping scope — no project/task-scoped recall. agent-kit's council now calls the knowledge MCP directly for scope control; agents-api's RAG should forward scope.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: agentsAgent runtime, agent APIs, tools, prompts, or UI.type: bugSomething is broken or behaving incorrectly.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions