refactor(shared): extract task contracts and model policy - #3616
Conversation
|
😎 Merged successfully - details. |
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
8c39d0e to
f08bac5
Compare
jonathanlab
left a comment
There was a problem hiding this comment.
shared can be used for exporting contract types, but now we're also moving a ton of logic in to there, which should move to core.
The aim is to make core a reusable set of logic by different surfaces, web, mobile, desktop, which does not rely on any platform dependencies. If we move too much logic into shared it risks becoming this unstructured dependency layer, which can bypass all the strict architectural boundaries we're enforcing around core.
c0ffe74 to
88a0684
Compare
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
apps/mobile/src/features/tasks/composer/options.ts:84-89
**Reasoning options ignore selected model**
When a user selects Claude Sonnet 4.6, the picker still exposes the Opus-derived `xhigh` and `max` levels, and the selected value is sent directly in the run payload or `set_config_option` command. Shared policy supports only `low`, `medium`, and `high` for Sonnet 4.6, so these selections produce an unsupported configuration that is rejected or misapplied.
Reviews (1): Last reviewed commit: "Merge main into shared task foundations" | Re-trigger Greptile |
|
moved the composer policy into core in #3637, so shared is back to contracts and primitives. |
01d914f to
c5f360f
Compare
Generated-By: PostHog Code Task-Id: c1bbe3cf-742b-4b24-bf96-d11a18b4cf22
Generated-By: PostHog Code Task-Id: c1bbe3cf-742b-4b24-bf96-d11a18b4cf22
Generated-By: PostHog Code Task-Id: c1bbe3cf-742b-4b24-bf96-d11a18b4cf22
Generated-By: PostHog Code Task-Id: c1bbe3cf-742b-4b24-bf96-d11a18b4cf22
Keep the extracted domain declaration as the single source after rebasing onto current main. Generated-By: PostHog Code Task-Id: c1bbe3cf-742b-4b24-bf96-d11a18b4cf22
fe7ba5d to
3f608f2
Compare
Generated-By: PostHog Code Task-Id: c1bbe3cf-742b-4b24-bf96-d11a18b4cf22
Preserve the shared model-policy extraction while incorporating current main's Modal model support. Generated-By: PostHog Code Task-Id: c1bbe3cf-742b-4b24-bf96-d11a18b4cf22
|
GitHub considers this PR to be a part of a stack - GitHub has not rolled out support for Trunk to work with these stacks yet, so our merge queue will be unable to merge this PR. Until GitHub does, you must tear down a PR's stack before submitting it to the merge queue (see here). For more help, please raise this with GitHub. |

Problem
Desktop task contracts and model policy were tied to agent-specific modules, preventing other hosts from reusing them without duplicating behavior. Two current-main UI tests also asserted before asynchronous tab and Markdown content mounted under CI load.
Refs PostHog/posthog#76229
Changes
Phase 1 only: I moved the existing desktop contracts and model policy into
@posthog/shared. Mobile remains unchanged. The UI test changes only wait for rendered behavior and do not change product behavior.How did you test this?
Automatic notifications
Created with PostHog Code