Skip to content

fix(llma): default prompts url#423

Merged
Radu-Raicea merged 1 commit intomasterfrom
fix/prompts-default-url
Feb 4, 2026
Merged

fix(llma): default prompts url#423
Radu-Raicea merged 1 commit intomasterfrom
fix/prompts-default-url

Conversation

@Radu-Raicea
Copy link
Member

No description provided.

@Radu-Raicea Radu-Raicea enabled auto-merge (squash) February 4, 2026 15:07
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

log = logging.getLogger("posthog")

APP_ENDPOINT = "https://app.posthog.com"
APP_ENDPOINT = "https://us.posthog.com"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Default cloud host likely shouldn’t change from app.posthog.com to us.posthog.com.

Changing APP_ENDPOINT to https://us.posthog.com alters the default API base for anyone who previously relied on the implicit default (including EU Cloud users). If the intent is to fix the prompts API specifically, consider either keeping APP_ENDPOINT as app.posthog.com or deriving the prompts base from an existing canonical host constant used elsewhere in the SDK (or documenting that host must be set for non-US regions).

Prompt To Fix With AI
This is a comment left during a code review.
Path: posthog/ai/prompts.py
Line: 18:18

Comment:
[P1] Default cloud host likely shouldn’t change from `app.posthog.com` to `us.posthog.com`.

Changing `APP_ENDPOINT` to `https://us.posthog.com` alters the default API base for anyone who previously relied on the implicit default (including EU Cloud users). If the intent is to fix the *prompts* API specifically, consider either keeping `APP_ENDPOINT` as `app.posthog.com` or deriving the prompts base from an existing canonical host constant used elsewhere in the SDK (or documenting that `host` must be set for non-US regions).

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines 35 to 37
def create_mock_posthog(
self, personal_api_key="phx_test_key", host="https://app.posthog.com"
self, personal_api_key="phx_test_key", host="https://us.posthog.com"
):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Test helper default host hard-codes US cloud.

create_mock_posthog(..., host="https://us.posthog.com") bakes a region-specific assumption into most tests, which makes it harder to catch regressions where host handling differs between regions / self-hosted. It’d be more robust to keep the default host aligned with the SDK default (or parameterize host in the specific assertions that care about it).

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Prompt To Fix With AI
This is a comment left during a code review.
Path: posthog/test/ai/test_prompts.py
Line: 35:37

Comment:
[P2] Test helper default host hard-codes US cloud.

`create_mock_posthog(..., host="https://us.posthog.com")` bakes a region-specific assumption into most tests, which makes it harder to catch regressions where `host` handling differs between regions / self-hosted. It’d be more robust to keep the default host aligned with the SDK default (or parameterize host in the specific assertions that care about it).

<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>

How can I resolve this? If you propose a fix, please make it concise.

@Radu-Raicea Radu-Raicea merged commit f5719f3 into master Feb 4, 2026
21 checks passed
@Radu-Raicea Radu-Raicea deleted the fix/prompts-default-url branch February 4, 2026 15:10
@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

posthog-python Compliance Report

Date: 2026-02-04 15:10:17 UTC
Duration: 143866ms

⚠️ Some Tests Failed

27/29 tests passed, 2 failed


Capture Tests

⚠️ 27/29 tests passed, 2 failed

View Details
Test Status Duration
Format Validation.Event Has Required Fields 516ms
Format Validation.Event Has Uuid 1506ms
Format Validation.Event Has Lib Properties 1506ms
Format Validation.Distinct Id Is String 1506ms
Format Validation.Token Is Present 1506ms
Format Validation.Custom Properties Preserved 1506ms
Format Validation.Event Has Timestamp 1506ms
Retry Behavior.Retries On 503 7739ms
Retry Behavior.Does Not Retry On 400 3509ms
Retry Behavior.Does Not Retry On 401 3507ms
Retry Behavior.Respects Retry After Header 6600ms
Retry Behavior.Implements Backoff 21409ms
Retry Behavior.Retries On 500 6959ms
Retry Behavior.Retries On 502 7406ms
Retry Behavior.Retries On 504 7277ms
Retry Behavior.Max Retries Respected 18340ms
Deduplication.Generates Unique Uuids 1497ms
Deduplication.Preserves Uuid On Retry 7419ms
Deduplication.Preserves Uuid And Timestamp On Retry 13611ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry 6912ms
Deduplication.No Duplicate Events In Batch 1502ms
Deduplication.Different Events Have Different Uuids 1506ms
Compression.Sends Gzip When Enabled 1506ms
Batch Format.Uses Proper Batch Structure 1506ms
Batch Format.Flush With No Events Sends Nothing 1004ms
Batch Format.Multiple Events Batched Together 1505ms
Error Handling.Does Not Retry On 403 3507ms
Error Handling.Does Not Retry On 413 3506ms
Error Handling.Retries On 408 6510ms

Failures

retry_behavior.respects_retry_after_header

Retry delay too short: 91ms < 2500ms

error_handling.retries_on_408

Expected at least 2 requests, got 1

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