Skip to content

fix(coding-agent): allow subagents with prompt URL metadata - #160

Merged
Issacboy123 merged 1 commit into
mainfrom
fix/prompt-url-widget-subagents
Aug 30, 2026
Merged

Issacboy123 merged 1 commit into
mainfrom
fix/prompt-url-widget-subagents

Conversation

@Issacboy123

Copy link
Copy Markdown
Contributor

Summary

This PR fixes subagent spawning in trusted Diffex checkouts where the project-local prompt URL extension is loaded. The extension now observes submitted user messages without registering an execution-mutating hook, preserving its PR, issue, and advisory metadata display while allowing spawn_agent to proceed.

Reasoning

The prompt URL extension only reads user text to update terminal UI and session metadata, so message_start is the appropriate observation boundary. Keeping before_agent_start would continue triggering the fail-closed subagent policy, while weakening that policy would allow extensions that genuinely modify prompts or context to be bypassed by child sessions. The replacement event occurs before the provider request, so the prompt metadata display remains available without changing subagent security guarantees.

Changes

  • Moved prompt URL detection from before_agent_start to user message_start events.
  • Reused the existing user-content extraction helper for submitted messages.
  • Extended subagent policy coverage to verify that message_start observation handlers permit spawning.

Testing

  • node ../../node_modules/vitest/dist/cli.js --run test/suite/subagent-registration.test.ts
  • npm run check

@Issacboy123 Issacboy123 added the bug Something isn't working label Aug 30, 2026
@Issacboy123 Issacboy123 self-assigned this Aug 30, 2026
@Issacboy123
Issacboy123 merged commit 25b644e into main Aug 30, 2026
0 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants