microsoft / microsoft/sre-agent

[Feature Request] Forward URL query parameters to agent thread_context for deep-link automation

Open
#212 1 comment 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
PowerShell
Stars
160
Forks
97
Avg merge
2d 5h
Merged PRs (30d)
12

Description

## Problem

When a user navigates to the SRE Agent web frontend with URL query parameters (e.g., `.../views/thread/{id}?bugId=12345`), the **query parameters are stripped by the frontend** and never reach the agent's `thread_context`. The agent cannot read or act on URL-embedded context.

## Current Behavior

- User navigates to: `https://sre.azure.com/.../views/thread/{id}?bugId=12345&action=triage`
- The browser address bar shows the full URL with query params
- The SRE Agent frontend sends only the canonical URL to the backend — query params are **not forwarded**
- The agent's `thread_context` receives: `https://sre.azure.com/.../views/thread/{id}` (no params)
- Confirmed by testing (May 2026)

## Proposed Solution

The SRE Agent web UI frontend should read `window.location.search` and include all query parameters in the context payload sent to the agent backend. Options:

1. **Append to `thread_context`** — include the full URL with query params in the existing `thread_context` field
2. **New `url_params` field** — add a dedicated field in the context payload for structured query parameters (key-value pairs)
3. **Both** — full URL in `thread_context` + parsed params in `url_params` for easy programmatic access

This is a small frontend change — the data is already in `window.location.search`, it just needs to be passed through.

## Use Case

### One-Click Workflow Trigger from External Surfaces
Teams cards, dashboards, or emails can link directly to an SRE Agent thread with embedded context:
```
https://sre.azure.com/.../views/thread/{id}?bugId=12345
```

When the user clicks the link:
1. The agent reads the `bugId` param from `thread_context` on the first message
2. Auto-starts the relevant triage workflow
3. The user sees the investigation begin immediately — **zero typing required**

Without URL param forwarding, the user must manually type the ID after landing on the thread, breaking the one-click experience.

### Other Deep-Link Patterns
- `?resourceId=/subscriptions/.../providers/...` — pre-scope the agent to a specific Azure resource
- `?incident=INC001234` — auto-start incident investigation
- `?action=health-check` — trigger a specific workflow on thread open
- `?message=Check%20CPU%20on%20prod-app` — pre-fill the first message

## Impact

- **High** — enables true one-click automation from external surfaces (Teams cards, dashboards, emails, work items)
- Small frontend change with large workflow value
- Foundation for event-driven agent invocation from any URL-capable surface

## Environment

- Azure SRE Agent (GA)
- SRE Agent web frontend at sre.azure.com
- Tested and confirmed: params are stripped by the frontend (May 2026)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the web frontend entry point that builds the agent context payload and inspect how window.location.search is handled before thread_context is sent. Compare the canonical URL with the deep-link URL, then confirm that the selected query parameters arrive in the agent context without being stripped.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.