Skip to content

fix(agent): send scout chat runs to the signals gateway product - #84751

Merged
trunk-io[bot] merged 2 commits into
masterfrom
fix/desktop-signals-chat-gateway-product
Aug 19, 2026
Merged

fix(agent): send scout chat runs to the signals gateway product#84751
trunk-io[bot] merged 2 commits into
masterfrom
fix/desktop-signals-chat-gateway-product

Conversation

@skoob13

@skoob13 skoob13 commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Problem

  • Scout chat runs will fail against the LLM gateway as soon as a region gets a Signals OAuth application row.
  • Scout chat tasks carry the signals_chat origin, and resolveGatewayProduct has no entry for it.
  • The origin falls through to posthog_code, which a Signals-minted token does not authorize.

Changes

  • resolveGatewayProduct maps signals_chat to the signals product, next to signal_report and signals_scout.
  • The mapping also meters these runs against the interactive Signals budget, which resolves only when the declared product is signals.
  • This is the desktop half of feat(signals): report implementation #84066, split out because a PR cannot hold both desktop and backend changes. Desktop releases auto-update on their own schedule.
  • The two halves are safe in either order. No region has a Signals application row yet, so today signals_chat still mints under the Array app, which authorizes signals as well.

How did you test this code?

Automated only, and I did not run it locally: the nested products/desktop workspace was not installed in my checkout, so CI is the first run of gateway.test.ts on this change.

  • The existing parameterized case list gains signals_chat for both isInternal values.
  • It catches a regression that drops the origin back to posthog_code, which no other case covers.

Automatic notifications

  • Publish to changelog?

Docs update

None.

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Claude Code (Opus 5) wrote this. Skills invoked: /writing-pr-descriptions.

The commit is cherry-picked unchanged from #84066, where the "Desktop backend coupling" check failed it. I verified the two halves are independent: no backend file in that PR references signals_chat.

Scout chat tasks carry the `signals_chat` origin, which `resolveGatewayProduct` did not map, so they fell through to `posthog_code`.
Their tokens mint under the Signals OAuth application, which only the `signals` product authorizes, so every scout chat run would be rejected once a region has a Signals application row.

Mapping the origin also puts these runs on the interactive Signals budget: the cost key resolves from the token's marker only when the declared product is `signals`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@skoob13 skoob13 self-assigned this Aug 18, 2026
@trunk-io

trunk-io Bot commented Aug 18, 2026

Copy link
Copy Markdown

😎 Merged successfully - details.

@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit d17be32.

@hosthog

hosthog Bot commented Aug 18, 2026

Copy link
Copy Markdown

HostHog preview — posthog-desktop-web

The previews for this PR have been torn down and no longer serve.

@trunk-io

trunk-io Bot commented Aug 18, 2026

Copy link
Copy Markdown

Static BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@skoob13 skoob13 changed the title fix(desktop/agent): send scout chat runs to the signals gateway product fix(agent): send scout chat runs to the signals gateway product Aug 19, 2026
@skoob13
skoob13 marked this pull request as ready for review August 19, 2026 07:53
@pr-assigner-resolver-posthog
pr-assigner-resolver-posthog Bot requested a review from a team August 19, 2026 07:53
@github-actions

Copy link
Copy Markdown
Contributor

🤖 CI report

Trunk lane — does not run backend Python tests

This PR is assigned to a lane that does not run backend Python tests.

@greptile-apps

greptile-apps Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "fix(desktop/agent): send scout chat runs..." | Re-trigger Greptile

@skoob13 skoob13 added the stamphog Request AI approval (no full review) label Aug 19, 2026
@stamphog

stamphog Bot commented Aug 19, 2026

Copy link
Copy Markdown

Note

🤖 stamphog reviewed d17be328eea0ea2eea5fbae98baedd1009eb7913 — verdict: ESCALATE

This adds a gateway-authorization mapping entry (which product/budget a token is minted and billed under) — billing/auth-adjacent risky territory — and the author is not on the owning desktop team, with only bot thumbs-up reactions and no actual APPROVED/COMMENTED review.

  • 👍 on the PR from chatgpt-codex-connector[bot], greptile-apps[bot].
  • No formal review (APPROVED/COMMENTED) from an agent reviewer or human teammate — only reactions, which are weak evidence
  • Author is not a member of @PostHog/team-posthog-desktop, the owning team for the touched files
  • Change affects gateway product/budget authorization mapping, which is billing/auth-adjacent risky territory
Gate mechanics and policy version
Gate Result
prerequisites all clear
deny-list no deny categories matched
size 4L, 1F substantive, 14L/2F incl. docs/generated/snapshots — within ceiling
tier T1-agent / T1a-trivial (14L, 2F, single-area, fix)
stamphog 2.0.0b4 .stamphog/policy.yml @ 58a0411 · reviewed head d17be32

@stamphog stamphog Bot removed the stamphog Request AI approval (no full review) label Aug 19, 2026
@trunk-io
trunk-io Bot merged commit 22c81a3 into master Aug 19, 2026
252 of 253 checks passed
@trunk-io
trunk-io Bot deleted the fix/desktop-signals-chat-gateway-product branch August 19, 2026 11:59
@deployment-status-posthog

deployment-status-posthog Bot commented Aug 19, 2026

Copy link
Copy Markdown

Deploy status

Environment Status Deployed At Workflow
dev ✅ Deployed 2026-08-19 12:53 UTC Run
prod-us ✅ Deployed 2026-08-19 13:10 UTC Run
prod-eu ✅ Deployed 2026-08-19 13:10 UTC Run

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.

2 participants