|
1 | 1 | # PR 3761 Branch Status |
2 | 2 |
|
3 | | -## Scope |
| 3 | +## Purpose |
4 | 4 |
|
5 | | -This note summarizes the branches involved in PR `#3761` and the final state of each one from this worktree. |
| 5 | +This note describes what each relevant branch contains and how responsibilities are split, so it is easier to see where changes overlap. |
6 | 6 |
|
7 | 7 | PR: `https://github.com/simstudioai/sim/pull/3761` |
8 | 8 |
|
9 | 9 | ## Branches |
10 | 10 |
|
11 | 11 | ### `staging` |
12 | 12 |
|
13 | | -- Role: base branch of PR `#3761` |
14 | | -- Expected state: unchanged by this worktree |
15 | | -- Relationship to this work: `feat/opencode-optional-runtime` is intended to merge into `staging` |
| 13 | +Base branch for PR `#3761`. |
| 14 | + |
| 15 | +What it contains: |
| 16 | + |
| 17 | +- current shared integration baseline before OpenCode optional runtime lands |
| 18 | +- current default compose and deployment behavior |
| 19 | +- no PR-specific branch-only review fixes from this worktree |
| 20 | + |
| 21 | +What it does **not** contain yet: |
| 22 | + |
| 23 | +- the OpenCode branch work described below until PR `#3761` is merged |
16 | 24 |
|
17 | 25 | ### `feat/opencode-optional-runtime` |
18 | 26 |
|
19 | | -- Role: feature branch for the OpenCode integration and optional runtime overlay |
20 | | -- Local state: in sync with `origin/feat/opencode-optional-runtime` |
21 | | -- Worktree state at the end of this session: clean |
22 | | -- Latest commit at the end of this session: `5ab2b5f4c` |
| 27 | +Feature branch for PR `#3761`. |
| 28 | + |
| 29 | +Primary responsibility: |
| 30 | + |
| 31 | +- add the OpenCode integration and its optional runtime overlay without changing the existing default local/prod setups |
| 32 | + |
| 33 | +What it contains: |
| 34 | + |
| 35 | +- OpenCode block in Sim |
| 36 | +- OpenCode tools |
| 37 | +- OpenCode API routes |
| 38 | +- `apps/sim/lib/opencode` |
| 39 | +- wiring for `@opencode-ai/sdk` in Next/Vitest |
| 40 | +- async dropdown/combobox support needed by the integration |
| 41 | +- optional runtime files under `docker/opencode/` |
| 42 | +- `docker-compose.opencode.yml` |
| 43 | +- `docker-compose.opencode.local.yml` |
| 44 | +- deployment/runtime hardening for: |
| 45 | + - `OPENCODE_REPOSITORY_ROOT` |
| 46 | + - `OPENCODE_SERVER_PASSWORD` |
| 47 | + - retry/session handling |
| 48 | + - route error behavior |
| 49 | + - OpenCode runtime config guards |
| 50 | + |
| 51 | +What this branch intentionally preserves: |
| 52 | + |
| 53 | +- `docker-compose.local.yml` stays as the default local setup |
| 54 | +- `docker-compose.prod.yml` stays as the default production setup |
| 55 | +- OpenCode remains hidden by default behind `NEXT_PUBLIC_OPENCODE_ENABLED` |
23 | 56 |
|
24 | 57 | ### `origin/feat/opencode-optional-runtime` |
25 | 58 |
|
26 | | -- Role: remote branch backing PR `#3761` |
27 | | -- Remote state at the end of this session: matches local `feat/opencode-optional-runtime` |
28 | | -- Latest pushed commit at the end of this session: `5ab2b5f4c` |
29 | | - |
30 | | -## Final State Of `feat/opencode-optional-runtime` |
31 | | - |
32 | | -At the end of this session, the branch contains: |
33 | | - |
34 | | -- OpenCode block integration in Sim |
35 | | -- OpenCode tools, API routes, and `apps/sim/lib/opencode` |
36 | | -- optional OpenCode runtime overlay under `docker/` and dedicated compose files |
37 | | -- OpenCode hidden by default behind `NEXT_PUBLIC_OPENCODE_ENABLED` |
38 | | -- `docker-compose.local.yml` and `docker-compose.prod.yml` preserved as defaults |
39 | | -- external runtime hardening, including configurable `OPENCODE_REPOSITORY_ROOT` |
40 | | -- fail-fast production overlay behavior when `OPENCODE_SERVER_PASSWORD` is missing |
41 | | -- focused fixes for review feedback around: |
42 | | - - stale session retry handling |
43 | | - - repository resolution reuse |
44 | | - - internal URL leakage in route errors |
45 | | - - Docker runtime detection caching |
46 | | - - async selector refetch behavior in dropdown/combobox |
47 | | - - OpenCode retry session persistence |
48 | | - - root-path and retry-error hardening |
49 | | - - entrypoint port validation |
50 | | - |
51 | | -## Final Commit Sequence Applied In This Session |
52 | | - |
53 | | -- `1e174f75a` `fix(opencode): avoid redundant resolution and url leaks` |
54 | | -- `35fac8dd3` `fix(opencode): clean up low severity review notes` |
55 | | -- `35949bb16` `fix(opencode): harden root path and retry errors` |
56 | | -- `3458868ba` `refactor(opencode): keep base url helper private` |
57 | | -- `a27de0d7c` `fix(editor): avoid stale open-change fetch gating` |
58 | | -- `a8fb07354` `fix(opencode): persist fresh retry sessions` |
59 | | -- `2bb744a38` `fix(opencode): tighten retry and entrypoint guards` |
60 | | -- `5ab2b5f4c` `fix(editor): stabilize async option refetching` |
61 | | - |
62 | | -## End-State Summary |
63 | | - |
64 | | -- Current branch: `feat/opencode-optional-runtime` |
65 | | -- Base branch: `staging` |
66 | | -- PR branch remote: `origin/feat/opencode-optional-runtime` |
67 | | -- Local/remote divergence at the end of this session: none |
68 | | -- Worktree cleanliness at the end of this session: clean |
| 59 | +Remote branch backing PR `#3761`. |
| 60 | + |
| 61 | +Expected relationship: |
| 62 | + |
| 63 | +- should match local `feat/opencode-optional-runtime` |
| 64 | +- if local and remote diverge, local work has not been pushed yet or remote changed externally |
| 65 | + |
| 66 | +## Overlap And Boundaries |
| 67 | + |
| 68 | +### Product / app layer |
| 69 | + |
| 70 | +Owned here in `feat/opencode-optional-runtime`: |
| 71 | + |
| 72 | +- OpenCode block/tool/route/lib implementation |
| 73 | +- editor support required by the OpenCode selectors |
| 74 | + |
| 75 | +Possible overlap area: |
| 76 | + |
| 77 | +- shared editor components like dropdown/combobox |
| 78 | +- these are not OpenCode-only files, but this branch touches them only where needed for OpenCode async option behavior |
| 79 | + |
| 80 | +### Runtime / deployment layer |
| 81 | + |
| 82 | +Owned here in `feat/opencode-optional-runtime`: |
| 83 | + |
| 84 | +- optional OpenCode container/runtime bootstrap |
| 85 | +- optional compose overlays |
| 86 | + |
| 87 | +Boundary: |
| 88 | + |
| 89 | +- this branch should not replace the default local/prod compose files as the main path |
| 90 | +- it only adds overlays and guards around the optional runtime |
| 91 | + |
| 92 | +### Review-fix layer |
| 93 | + |
| 94 | +Many follow-up changes in this branch are not separate features. |
| 95 | + |
| 96 | +They are: |
| 97 | + |
| 98 | +- hardening fixes |
| 99 | +- correctness fixes |
| 100 | +- small refactors |
| 101 | +- review-driven adjustments on top of the same OpenCode feature branch |
| 102 | + |
| 103 | +That means several files now contain both: |
| 104 | + |
| 105 | +- original feature work |
| 106 | +- later review fixes |
| 107 | + |
| 108 | +So if something feels like it is "overlapping", that is expected: the branch has accumulated refinement passes on top of the original OpenCode implementation rather than splitting them into separate branches. |
| 109 | + |
| 110 | +## Final Branch State |
| 111 | + |
| 112 | +At the end of this session: |
| 113 | + |
| 114 | +- current branch: `feat/opencode-optional-runtime` |
| 115 | +- base branch: `staging` |
| 116 | +- remote tracking branch: `origin/feat/opencode-optional-runtime` |
| 117 | +- local/remote divergence: none |
| 118 | +- worktree state: clean |
| 119 | + |
| 120 | +## Practical Reading Guide |
| 121 | + |
| 122 | +If you want to understand the branch quickly, read it in this order: |
| 123 | + |
| 124 | +1. `apps/sim/lib/opencode/` |
| 125 | +2. `apps/sim/app/api/opencode/` |
| 126 | +3. `apps/sim/app/api/tools/opencode/` |
| 127 | +4. `apps/sim/blocks/blocks/opencode.ts` |
| 128 | +5. `docker/opencode/` |
| 129 | +6. `docker-compose.opencode.yml` |
| 130 | +7. `docker-compose.opencode.local.yml` |
| 131 | + |
| 132 | +If you want to understand where overlap happened, check these shared files next: |
| 133 | + |
| 134 | +- `apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/combobox/combobox.tsx` |
| 135 | +- `apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/dropdown/dropdown.tsx` |
| 136 | +- `apps/sim/app/api/tools/opencode/prompt/route.ts` |
0 commit comments