Skip to content

[Repo Assist] refactor: use result.Parameters in DeepLinkHandler instead of re-parsing query#108

Draft
github-actions[bot] wants to merge 1 commit intomasterfrom
repo-assist/improve-deeplink-params-20260325-ee0686e6ac43c387
Draft

[Repo Assist] refactor: use result.Parameters in DeepLinkHandler instead of re-parsing query#108
github-actions[bot] wants to merge 1 commit intomasterfrom
repo-assist/improve-deeplink-params-20260325-ee0686e6ac43c387

Conversation

@github-actions
Copy link
Contributor

🤖 This is an automated draft PR from Repo Assist.

Summary

DeepLinkParser.ParseDeepLink already parses the query string into result.Parameters (a case-insensitive Dictionary(string, string)). The Handle method was then calling DeepLinkParser.GetQueryParam on the raw query string a second time for the send and agent cases — redundant work that re-implemented parsing logic that had already run.

Change

  • Replace GetQueryParam(query, "message") with result.Parameters.GetValueOrDefault("message") in the send and agent switch cases
  • Remove the now-unused query local variable (previously var query = result.Query)

No behaviour change — both approaches produce identical results because ParseDeepLink uses Uri.UnescapeDataString and case-insensitive key comparison, same as GetQueryParam.

Why this is better

Before After
Query string parsed twice (once in ParseDeepLink, once in GetQueryParam) Parsed once; already-available data is reused
Two code paths that must stay in sync Single parse site
query variable held but passed to a static re-parser result.Parameters used directly

Test Status

503 tests passed (18 skipped — Windows-only integration tests), 93 Tray tests passed. No failures introduced.

Passed!  - Failed: 0, Passed: 503, Skipped: 18, Total: 521
Passed!  - Failed: 0, Passed: 93,  Skipped: 0,  Total: 93

Generated by Repo Assist ·

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@cbb46ab386962aa371045839fc9998ee4e97ca64

…ing query

DeepLinkParser.ParseDeepLink already parses the query string into
result.Parameters (case-insensitive dictionary). The Handle method was
calling GetQueryParam on the raw query string a second time for the
'send' and 'agent' cases — redundant work that also duplicated the
parsing logic.

Replace the GetQueryParam calls with result.Parameters.GetValueOrDefault
and remove the now-unused `query` local variable. No behaviour change.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants