Conversation
|
Size Change: 0 B Total Size: 129 MB ℹ️ View Unchanged
|
Prompt To Fix All With AIThis is a comment left during a code review.
Path: products/tasks/backend/serializers.py
Line: 230-260
Comment:
**`parse_run_state` called 4× per serialized object**
Each of the four `get_*` methods independently calls `parse_run_state(obj.state)`, which runs Pydantic JSON-coercion on the same dict every time. When a list endpoint returns many `TaskRun` objects, the state is parsed 4× per row. Extracting the parsed state once — e.g. with a private helper — would satisfy OnceAndOnlyOnce and avoid the repeated work.
```python
def _get_run_state(self, obj: TaskRun) -> RunState:
return parse_run_state(obj.state)
def get_runtime_adapter(self, obj: TaskRun) -> str | None:
state = self._get_run_state(obj)
return state.runtime_adapter.value if state.runtime_adapter is not None else None
# … and so on for get_provider, get_model, get_reasoning_effort
```
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/tests/test_api.py
Line: 377-381
Comment:
**Single-case `@parameterized.expand`**
The decorator wraps only `("high",)`. Since Codex supports `low`, `medium`, and `high`, the parameterized machinery adds overhead (name mangling, extra test node) with no coverage benefit over a plain test. Either expand to all valid efforts or remove the decorator.
```python
@parameterized.expand(
[
("low",),
("medium",),
("high",),
]
)
```
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/tests/test_api.py
Line: 431-450
Comment:
**Incomplete coverage for missing-field validation**
The payload omits both `provider` and `model`, so the `validate()` loop adds errors for both. The assertion only checks `attr: "provider"`, relying implicitly on Python dict insertion order to make that error win. There is no test that sending `provider` alone (without `model`) also returns a validation error. A second parameterised case (or a separate test) that omits `model` instead of `provider` would make the requirement explicit.
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "feat(cloud-agent): codex support" | Re-trigger Greptile |
8ad5e7d to
a276aac
Compare
|
⏭️ Skipped snapshot commit because branch advanced to The new commit will trigger its own snapshot update workflow. If you expected this workflow to succeed: This can happen due to concurrent commits. To get a fresh workflow run, either:
|
Query snapshots: Backend query snapshots updatedChanges: 1 snapshots (1 modified, 0 added, 0 deleted) What this means:
Next steps:
|
|
🎭 Playwright report · View test results →
These issues are not necessarily caused by your changes. |
joshsny
left a comment
There was a problem hiding this comment.
LGTM - this is a nice cleanup
091f6d3 to
14ef67e
Compare
|
⏭️ Skipped snapshot commit because branch advanced to The new commit will trigger its own snapshot update workflow. If you expected this workflow to succeed: This can happen due to concurrent commits. To get a fresh workflow run, either:
|
Query snapshots: Backend query snapshots updatedChanges: 1 snapshots (1 modified, 0 added, 0 deleted) What this means:
Next steps:
|
chore: cleaner test(backend): update query snapshots
078fb59 to
93e18e6
Compare
Query snapshots: Backend query snapshots updatedChanges: 1 snapshots (1 modified, 0 added, 0 deleted) What this means:
Next steps:
|
Problem
cloud runs need an explicit runtime contract so the selected LLM adapter, provider, model, and reasoning effort are preserved across task creation, resume, and sandbox startup.
This allows us to have
codexsupport E2E also for flows outside of PostHog Code (slack interaction and PostHog Tasks UI directly, logic is not plumbed but after this rework it would be an easy addition)Changes
Companion: PostHog/code#1644