Merged
Conversation
25150a8 to
d269b26
Compare
Contributor
|
Size Change: 0 B Total Size: 128 MB ℹ️ View Unchanged
|
Contributor
Prompt To Fix All With AIThis is a comment left during a code review.
Path: products/tasks/backend/temporal/process_task/utils.py
Line: 209-212
Comment:
**Stale docstring references old bot identity**
The docstring still refers to the old Dockerfile defaults (`"Array"` / `array@posthog.com`), but those were updated to `"PostHog Code"` / `code@posthog.com` in this same PR.
```suggestion
"""Return git author/committer env vars for the sandbox.
Runs with user authorship are attributed to the user who created the task.
Bot-authored runs fall back to the Dockerfile defaults ("PostHog Code" /
code@posthog.com).
"""
```
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: products/tasks/backend/api.py
Line: 299-300
Comment:
**Validation only guards token requirement when a repository is set**
When `pr_authorship_mode = "user"` but `task.repository` is falsy, the validation passes and no token is cached. Later, in `get_sandbox_github_token`, if `pr_authorship_mode = "user"` is present in the run's state, the code raises a `ValueError` for the missing cached token — even though the activity itself is also guarded by `if has_repo` / `if ctx.github_integration_id is not None`.
This is actually consistent and safe today (no GitHub API call happens when there's no integration ID), but it means a task could have `pr_authorship_mode = "user"` in its state while never having had a token cached — which may be surprising if a repository is later attached or the state is inspected. A clarifying inline comment would help readers understand why the `task.repository` guard is intentional here.
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "chore: update OpenAPI generated types" | Re-trigger Greptile |
3f06700 to
ebfdcc4
Compare
c0f2c8a to
b94151e
Compare
skoob13
approved these changes
Apr 9, 2026
Contributor
skoob13
left a comment
There was a problem hiding this comment.
Looks good to me. I don't have full context here, but a side idea: it'd be great if we could co-author PRs with PostHog Code and user. It might already work like that, though.
8fad762 to
ff8ebf1
Compare
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
Cloud runs commits and PRs are always authored as the a bot, regardless of who initiated the task. Users who manually start cloud runs from PostHog Code expect their PRs to appear under their own GH identity.
Changes
code, theirgh auth tokenis cached ephemerally in Redis and injected into the sandboxpr_authorship_mode,run_source,signal_report_idfields on the run request, persisted inTaskRun.stateand carried forward on resume task processCompanion PR: PostHog/code#1453
Publish to changelog?
No.