Skip to content

feat(hooks): add synchronous prompt submission plumbing - #466

Draft
tumberger wants to merge 1 commit into
mainfrom
jens/eng-624-c1-prompt-hook-wire
Draft

tumberger wants to merge 1 commit into
mainfrom
jens/eng-624-c1-prompt-hook-wire

Conversation

@tumberger

@tumberger tumberger commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

ENG-624 CLI stack 1/6.

Makes UserPromptSubmit a first-class synchronous hook event across the domain and local wire, preserves compatibility mirrors, and gives prompt processing a 65-second budget while keeping normal tool-call budgets unchanged.

The prompt itself is always accepted. Subsequent tool use waits for the corresponding session policy set.

@greptile-apps

greptile-apps Bot commented Aug 15, 2026

Copy link
Copy Markdown

Greptile Summary

The PR makes UserPromptSubmit a first-class synchronous hook event across agent codecs and the local runtime protocol.

  • Adds first-class prompt transport while retaining the ToolInput compatibility mirror.
  • Encodes prompt denials for Claude and preserves Codex prompt handling.
  • Introduces protocol version 2 fields on local evaluate requests and results.
  • Gives managed prompt evaluation a 60-second lifecycle budget and Codex prompt hooks a 65-second timeout while retaining existing budgets for other events.

Confidence Score: 5/5

The PR appears safe to merge with no concrete blocking or independently actionable non-blocking defects identified.

The prompt is preserved across both agent adapters and the local runtime transport, blocking prompt hooks remain synchronous, and the investigated timeout and compatibility paths do not produce an established failure with current consumers.

Important Files Changed

Filename Overview
internal/hook/domain.go Adds the first-class Prompt field while documenting the temporary ToolInput compatibility mirror.
internal/hookruntime/claude.go Preserves Claude prompt input and adds event-specific synchronous UserPromptSubmit result encoding.
internal/hookruntime/codex.go Populates the first-class Prompt field alongside the existing normalized Codex input.
internal/localruntime/protocol.go Extends the local wire structs with protocol versioning and first-class prompt transport.
internal/localruntime/conversions.go Round-trips Prompt and emits protocol version 2 for evaluate requests and results.
internal/managedobserve/lifecycle.go Routes UserPromptSubmit through synchronous daemon kickstart processing with a 60-second budget.
internal/codexmanaged/hooks.go Applies a 65-second timeout only to installed Codex prompt hooks.

Sequence Diagram

sequenceDiagram
  participant Agent as Claude Code / Codex
  participant Hook as Hook codec
  participant Client as Managed lifecycle
  participant Socket as localruntime.Service
  participant Policy as Runtime policy
  Agent->>Hook: UserPromptSubmit(prompt)
  Hook->>Client: "hook.Event{Prompt, ToolInput mirror}"
  Client->>Socket: EvaluateRequest v2
  Socket->>Policy: synchronous evaluation
  Policy-->>Socket: allow / deny
  Socket-->>Client: EvaluateResult v2
  Client-->>Hook: hook.Result
  Hook-->>Agent: allow context or block reason
Loading

Reviews (1): Last reviewed commit: "feat(hooks): add synchronous prompt subm..." | Re-trigger Greptile

@tumberger
tumberger marked this pull request as draft August 15, 2026 13:34
@tumberger
tumberger force-pushed the jens/eng-624-c1-prompt-hook-wire branch from b0eb50f to 83d551c Compare August 26, 2026 09:00
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