Repository navigation
Description
I'm an AI agent (Claude Code) helping Engel Nyst (@enyst) with project maintenance.
The verify-sdk feature map (#5750) found this bug while driving the SDK through its public API. The map records it as a known failure, and the command under Steps to Reproduce shows it on main.
Is there an existing issue for the same bug?
- I have searched existing issues and this is not a duplicate.
Bug Description
Sub-agent LLM calls carry the parent conversation's id as prompt_cache_key, so delegated work shares the parent's cache shard. That holds when a task is created, but TaskManager._resume_task builds the LocalConversation without prompt_cache_key=... (unlike _get_conversation), so the call after task(resume=...) carries the sub-conversation's own id.
Expected Behavior
Every sub-agent call carries the parent's id, on create and on resume (sub_cache_key_is_parent is [true, true, true]).
Actual Behavior
[true, true, false].
Steps to Reproduce
From a checkout of main (uv sync), with the verify-sdk tools on the path:
export PATH="$PWD/.agents/skills/verify-sdk/scripts:$PATH"
sdk-map run --file S11 --only S11.task-observabilityThat runs this recipe from the map (each control-sdk call runs a short program in its own HOME, persistence and workspace):
export SDK_VERIFY_RUN=$(control-sdk new --field run)
control-sdk program S11/task_lifecycle \
--check sub_cache_key_is_parent.0 eq true --check sub_cache_key_is_parent.1 eq true \
--check sub_cache_key_is_parent.2 eq true --check sub_session_differs eq trueAcceptance Criteria
- A resumed task's calls carry the parent's
prompt_cache_key. - A test covers resume.
- The
S11.task-observabilitybullet in.agents/skills/verify-sdk/references/feature-map/passes and its known-failure note is removed.
Installation Method
uv sync in a checkout of main
OpenHands AI triage
The following comments and acceptance criteria were added by the OpenHands AI agent.
Triage
Verified on main: TaskManager._get_conversation (task creation) builds the sub-conversation with prompt_cache_key=str(parent.state.id), but TaskManager._resume_task builds the LocalConversation without it, so LocalConversation falls back to its own conversation id and a resumed task starts a new prompt-cache shard. The repository's verify-sdk feature map records the same failure under S11.task-observability (reproduced 2026-10-13). Scope: make _resume_task construct the sub-conversation the same way the create path does, per the repository lifecycle rule that resumed conversations preserve the same observable configuration and behavior as newly created ones. All resume paths funnel through _resume_task, so one construction fix covers them.
Non-goals: no change to the task-creation path or to LocalConversation's default own-id prompt_cache_key for non-delegate conversations; no change to delegate trace metadata or tagging (the Laminar-backed observability item remains blocked and separate); no agent-server, remote-conversation, or TypeScript client changes; no new public API surface.
Acceptance Criteria
- After
task(resume="task_..."), the resumed task's sub-conversation LLM call context carriesprompt_cache_keyequal to the parent conversation's id (theS11.task-lifecyclescenario reportssub_cache_key_is_parentastruefor the resume call, i.e.[true, true, true]). - A regression test in
tests/tools/task/test_task_manager.pyasserts that a resumed task'sLocalConversation.get_llm_call_context().prompt_cache_keyequalsstr(parent.state.id), as the resume-path counterpart oftest_sub_agents_inherit_parent_prompt_cache_key. - The
S11.task-observabilityrecipe passes (sdk-map run --file S11 --only S11.task-observability) and the known-failure note about the resume call carrying the sub-conversation's own id is removed from.agents/skills/verify-sdk/references/feature-map/S11-subagents-delegation.md. - Task creation is unchanged: a newly created task's calls still carry the parent's
prompt_cache_key(existingtest_sub_agents_inherit_parent_prompt_cache_keykeeps passing).
Activity
docs(verify-sdk): tighten S11, S16 and S17 checks after the re-check