fix(desktop): inherit Opus 5 for delegated agents - #80325
Conversation
Generated-By: PostHog Code Task-Id: a119b464-000b-46da-a44c-00e638b9dfaf
|
😎 Merged successfully - details. |
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
Prompt To Fix All With AI### Issue 1
products/desktop/packages/agent/src/adapters/claude/session/options.ts:102
**Accessor uses inconsistent absence sentinel**
The new current-model accessor represents an intentionally unavailable model with `undefined` rather than the repository-standard `null`, introducing another missing-value convention that callers and tests must distinguish.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "fix(desktop): inherit Opus 5 for delegat..." | Re-trigger Greptile |
| /** Called after createTaskHook mutates taskState so callers can emit a plan | ||
| * sessionUpdate to the client. */ | ||
| onTaskStateChange?: () => Promise<void>; | ||
| /** Returns the canonical model selected for the live parent session. */ |
There was a problem hiding this comment.
Accessor uses inconsistent absence sentinel
The new current-model accessor represents an intentionally unavailable model with undefined rather than the repository-standard null, introducing another missing-value convention that callers and tests must distinguish.
Rule Used: Use 'null' instead of 'undefined' to indicate an i... (source)
Learned From
PostHog/posthog#32556
Prompt To Fix With AI
This is a comment left during a code review.
Path: products/desktop/packages/agent/src/adapters/claude/session/options.ts
Line: 102
Comment:
**Accessor uses inconsistent absence sentinel**
The new current-model accessor represents an intentionally unavailable model with `undefined` rather than the repository-standard `null`, introducing another missing-value convention that callers and tests must distinguish.
**Rule Used:** Use 'null' instead of 'undefined' to indicate an i... ([source](https://app.greptile.com/posthog-org-19734/-/custom-context?memory=0631667e-2260-42be-a589-0d8da9ef007d))
**Learned From**
[PostHog/posthog#32556](https://github.com/PostHog/posthog/pull/32556)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.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!
There was a problem hiding this comment.
Contained, well-tested change to internal desktop-agent model-selection logic with no touch on risky territory (no data model, API contract, auth, billing, or CI surface); the one open comment is a stylistic nit (undefined vs null sentinel), not a substantive concern.
- greptile-apps[bot] reviewed the current head.
- Unresolved Greptile inline comment about using undefined instead of null for the absence sentinel — stylistic, not blocking.
Gate mechanics and policy version
| Gate | Result | |
|---|---|---|
| prerequisites | ✓ | all clear |
| deny-list | ✓ | no deny categories matched |
| size | ✓ | 57L, 3F substantive, 139L/4F incl. docs/generated/snapshots — within ceiling |
| tier | ✓ | T1-agent / T1c-medium (139L, 4F, single-area, fix) |
| stamphog 2.0.0b4 | .stamphog/policy.yml @ 6c6bd48 · reviewed head 07d3341 |
Problem
Delegated Claude reviews can run on an older Opus generation when the parent session uses Claude Opus 5 and the Agent call requests the
opusalias.Why: Fresh-context reviews should use the requested parent model tier instead of silently selecting an older family alias.
Changes
opustoinheritonly when the parent selectedclaude-opus-5