fix(agent): bill signals scouts and all signal-report tasks to signals product#2738
Merged
joshsny merged 4 commits intoJun 17, 2026
Merged
Conversation
…s product Route both signal-report tasks and headless scout runs (origin_product `signals_scout`) to the `signals` gateway product, regardless of whether the run is internal. Generated-By: PostHog Code Task-Id: be68dc37-6c5b-424c-845e-ad3f514f16df
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
Contributor
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
packages/agent/src/server/agent-server.configure-environment.test.ts:130-150
These two tests follow identical shapes — `buildServer("background").configureEnvironment({isInternal: false, originProduct: X})` → check `LLM_GATEWAY_URL` — and would be cleaner as a single `it.each`, matching the team's preference for parameterised tests. The description of the second test also says "internal or not" but only exercises `isInternal: false`; the internal path is only covered in `gateway.test.ts`.
```suggestion
it.each([
{ originProduct: "signal_report" as const },
{ originProduct: "signals_scout" as const },
])(
"tags as signals for signals-originated work (origin_product '$originProduct') regardless of internal flag",
({ originProduct }) => {
buildServer("background").configureEnvironment({
isInternal: false,
originProduct,
});
expect(process.env.LLM_GATEWAY_URL).toBe(
"https://gateway.us.posthog.com/signals",
);
},
);
```
Reviews (1): Last reviewed commit: "fix(agent): bill signals scouts and all ..." | Re-trigger Greptile |
Generated-By: PostHog Code Task-Id: be68dc37-6c5b-424c-845e-ad3f514f16df
…ment Generated-By: PostHog Code Task-Id: be68dc37-6c5b-424c-845e-ad3f514f16df
Generated-By: PostHog Code Task-Id: be68dc37-6c5b-424c-845e-ad3f514f16df
Contributor
|
Reviews (2): Last reviewed commit: "chore(agent): drop redundant comment on ..." | Re-trigger Greptile |
andrewm4894
approved these changes
Jun 17, 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.
Problem
LLM usage from the Signals product wasn't fully attributed to the
signalsgateway product. Only internal signal-report tasks routed tosignals; non-internal signal-report tasks fell through toposthog_code, and headless scout runs (origin_product = signals_scout) weren't routed tosignalsat all.Changes
resolveGatewayProductnow routes any signals-originated work to thesignalsgateway product regardless of the internal flag:signal_reporttasks →signals(previously only when internal)signals_scout(headless scout runs) →signals(new)Task["origin_product"]in@posthog/sharedgains thesignals_scoutmember to match the backendOriginProductenum (products/tasks/backend/models.py), where the scout origin product issignals_scout.How did you test this?
Ran the affected unit tests:
pnpm --filter @posthog/agent exec vitest run src/utils/gateway.test.ts src/server/agent-server.configure-environment.test.ts— 41 passing, including new cases for non-internalsignal_reportand both internal/non-internalsignals_scout. Also rantsc --noEmiton the agent package and biome on the touched files.Automatic notifications
Created with PostHog Code from a Slack thread