[AI-6222] Add newChat and autoSend options to SDK trigger API#31
Merged
Conversation
Support hash params angie-newChat=true and angie-autoSend=true for controlling chat creation and auto-sending from URL-based triggers. Forward options through the postMessage bridge to the iframe. Made-with: Cursor
Wiz Scan Summary
To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension. |
Made-with: Cursor
Contributor
Author
|
✅ Addressed 0/0 open review comments Findings: Fixed: N/A — no human or actionable inline review feedback on this PR. Skipped:
Additional (not from a review thread): Committed ESLint fix in Tests passing | Lint clean Note 🤖 Generated by Angie's Review Agent |
ofir5300
approved these changes
Apr 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
angie-newChat=trueandangie-autoSend=truehash params inhandlePromptHashusing properURLSearchParamsparsingnewChatandautoSendtoAngieTriggerRequest.optionsand forward through the postMessage bridge to the iframefalsewhen params are absentChanges
src/types.ts: AddnewChat?: booleanandautoSend?: booleantooptionssrc/angie-mcp-sdk.ts: Refactor hash parsing withparseHashParams(), passoptions.newChat/options.autoSendtotriggerAngiesrc/sdk.ts: ForwardoptionsinSDK_TRIGGER_ANGIEpayload to iframesrc/angie-mcp-sdk.test.ts: Tests for hash parsing and trigger with newChat/autoSendTest plan
npx jest— all 140 tests passwp-admin#angie-prompt=Fix%20error&angie-newChat=true&angie-autoSend=true— verify new chat opens and prompt auto-sendsNotes
Supersedes #24 — this approach keeps
newChat/autoSendunderoptions(alongsidetimeout) rather than top-level, and addsautoSendsupport.Made with Cursor
✨ PR Description
1. Problem & Context
Jira: AI-6222
Extends the SDK trigger API to support starting new chat sessions and auto-sending prompts. Previously, hash-based triggers could only populate the input field; now they can optionally clear context (newChat) and immediately submit (autoSend). This enables deep-linking workflows where external systems can fully automate Angie interactions, not just pre-fill prompts.
2. What Changed (Where)
angie-mcp-sdk.ts: AddednewChatandautoSendhash parameter parsing; refactoredhandlePromptHash()to useURLSearchParamsinstead of string replacementtypes.ts: ExtendedAngieTriggerRequest.optionsinterface withnewChatandautoSendboolean fieldssdk.ts: Updated message relay to forwardoptionsobject to iframeangie-mcp-sdk.test.ts: Added comprehensive test coverage for new hash parsing logic and parameter combinationsiframe.test.ts: FixedsetTimeoutreturn type for Node compatibility (unrelated cleanup)3. How It Works
Hash parameters (
#angie-prompt=X&angie-newChat=true&angie-autoSend=true) are parsed viaURLSearchParams. ThehandlePromptHash()method extracts prompt + flags, then passes them through the existingtriggerAngie()flow. Theoptionsobject propagates from SDK → parent window → iframe message payload. Defaults tofalsefor both flags when omitted, preserving backward compatibility with existing#angie-prompt=XURLs.4. Risks
None. Additive change with defensive defaults. Existing integrations unaffected since new parameters are optional and default to
false. Test coverage validates all combinations (both flags, one flag, no flags, empty prompt).Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Description using Guidelines Learn how