Skip to content

fix(desktop): inherit Opus 5 for delegated agents - #80325

Merged
trunk-io[bot] merged 1 commit into
masterfrom
posthog-code/inherit-opus-5-subagents
Aug 10, 2026
Merged

fix(desktop): inherit Opus 5 for delegated agents#80325
trunk-io[bot] merged 1 commit into
masterfrom
posthog-code/inherit-opus-5-subagents

Conversation

@tatoalo

@tatoalo tatoalo commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

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 opus alias.

Why: Fresh-context reviews should use the requested parent model tier instead of silently selecting an older family alias.

Changes

  • Rewrite Agent calls from opus to inherit only when the parent selected claude-opus-5
  • Preserve explicit model choices and existing behavior for older Opus parents

Generated-By: PostHog Code
Task-Id: a119b464-000b-46da-a44c-00e638b9dfaf
@trunk-io

trunk-io Bot commented Aug 10, 2026

Copy link
Copy Markdown

😎 Merged successfully - details.

@github-actions

Copy link
Copy Markdown
Contributor

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 07d3341.

@PostHog PostHog deleted a comment from github-actions Bot Aug 10, 2026
@tatoalo
tatoalo marked this pull request as ready for review August 10, 2026 09:10
@tatoalo tatoalo added the stamphog Request AI approval (no full review) label Aug 10, 2026
@tatoalo
tatoalo enabled auto-merge (squash) August 10, 2026 09:10
@greptile-apps

greptile-apps Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor
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. */

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 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!

@stamphog stamphog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

@trunk-io

trunk-io Bot commented Aug 10, 2026

Copy link
Copy Markdown

Static BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@trunk-io
trunk-io Bot merged commit 2959fe2 into master Aug 10, 2026
321 checks passed
@trunk-io
trunk-io Bot deleted the posthog-code/inherit-opus-5-subagents branch August 10, 2026 09:44
@deployment-status-posthog

deployment-status-posthog Bot commented Aug 10, 2026

Copy link
Copy Markdown

Deploy status

Environment Status Deployed At Workflow
dev ✅ Deployed 2026-08-10 10:16 UTC Run
prod-us ✅ Deployed 2026-08-10 10:30 UTC Run
prod-eu ✅ Deployed 2026-08-10 10:33 UTC Run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature/desktop Feature Tag: Desktop stamphog Request AI approval (no full review)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant