Skip to content

feat(sessions): task-bearing agent sessions (task param + engine-side template expansion) - #696

Merged
thedancingdeveloper merged 1 commit into
mainfrom
feat/session-task-and-agent-template
Sep 11, 2026
Merged

thedancingdeveloper merged 1 commit into
mainfrom
feat/session-task-and-agent-template

Conversation

@thedancingdeveloper

Copy link
Copy Markdown
Contributor

What

The second half of "the app struggles to understand me": even understood correctly, "spawn a session and check the containers" couldn't be carried out. Two gaps:

  1. No task could be carried. A session opened on the project brief — which states there is no task — so the agent waited and the user re-typed what they'd said. session.start gains a task parameter, folded into the brief under ## Task.
  2. template ran an unwrapped binary. The core sent template as a literal command (["claude"]), not the deployment's protected ["vogt-agent-auth","run","--","claude"]. Now the core sends the template name, and the engine expands it against its own session_templates (by name, then tag; an agent-tagged template wins an ambiguous tag, so claude → the protected Claude Code template). The wrapper stays in deployment config, never in shipped code. Unknown name → 400 listing the configured templates.

Together: "start a session on komodo and check the containers" opens a protected Claude agent already briefed to check them.

Scope / safety

Changes

  • Contract: SessionSpec.template.
  • Engine: resolve_template_in (name → tag, agent-tag wins ambiguity) + expansion in SessionRegistry::create.
  • Core: StartSessionParams.task, EngineClient.create_session(template=…), _brief_with_task.
  • Tests: template resolves by name then tag, agent tag wins, unknown refused (engine); task folds into the brief / absent without it, template sent by name (core).
  • Docs: SessionSpec.template in ENGINE.md.

Verified

Engine fmt + clippy -D warnings + sessions::/api::/agent_tasks:: (48 tests). Core ruff/mypy + test_sessions.py/test_session_outcomes.py (72) and the config-doc drift check.

PR 2 of 3 (after #695 dictation vocabulary). PR 3 adds server-STT vocabulary + a client preference.

🤖 Generated with Claude Code

https://claude.ai/code/session_01YG9Nsxqc6CREb56Uisnmmy

@thedancingdeveloper
thedancingdeveloper force-pushed the feat/session-task-and-agent-template branch from a900584 to 7e61cef Compare September 11, 2026 02:14
…n agent on X

Two gaps behind "spawn a session and check the containers":

1. The session tool had nowhere to put the *doing* part. A session opened
   on the project brief, which says in as many words that there is no task,
   and the agent waited — the person then typed what they had just said.
   session.start gains `task`, folded into the brief under a `## Task`
   heading so the agent opens already asked to do it.

2. `template` reached the engine as a literal command (`["claude"]`), an
   unwrapped binary, not the deployment's protected
   `["vogt-agent-auth", "run", "--", "claude"]`. Vogt now sends the template
   *name*; the engine expands it against its own `session_templates` by name
   or tag (an `agent`-tagged template wins an ambiguous tag, so `claude`
   reaches the protected Claude Code template). The wrapper stays in
   deployment config, out of the core and out of shipped code. An unknown
   name is 400 listing the configured templates, never silently a shell.
   Only taken when no explicit command is given, so the GUI (which sends a
   command) is untouched.

The two together mean "start a session on komodo and check the containers"
can open a protected Claude agent already briefed to check them.

Engine: SessionSpec.template (contract) + resolve_template_in over the
configured templates + expansion in SessionRegistry::create. Core:
StartSessionParams.task, EngineClient.create_session template kwarg,
_brief_with_task. Tests: template resolves by name then tag, agent tag wins
ambiguity, unknown is refused; task folds into the brief and is absent
without it; the template is sent by name for the engine to expand.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YG9Nsxqc6CREb56Uisnmmy
@thedancingdeveloper
thedancingdeveloper force-pushed the feat/session-task-and-agent-template branch from 7e61cef to 2ba8db6 Compare September 11, 2026 02:15
@thedancingdeveloper
thedancingdeveloper merged commit 6592f31 into main Sep 11, 2026
16 checks passed
@thedancingdeveloper
thedancingdeveloper deleted the feat/session-task-and-agent-template branch September 11, 2026 02:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant