Skip to content

Commit e0cab03

Browse files
pRizzclaude
andcommitted
fix: prevent [object Object] in error toasts and document fork-isolation policy
Update submodule with fix for toast error display (String(e) → instanceof Error check) and new errorMessage utility in fork-ui. Add Fork Isolation section to CLAUDE.md and AGENTS.md to codify upstream modification policy. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent cc8f60c commit e0cab03

4 files changed

Lines changed: 22 additions & 2 deletions

File tree

AGENTS.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@ This is a polyglot monorepo with Rust and TypeScript:
2323
- `packages/cli-node/` - Node.js CLI wrapper
2424
- `packages/opencode/` - Git submodule pointing to our fork of the opencode repository. We own this fork and can freely modify, commit, and push changes to it.
2525

26+
## Fork Isolation (Upstream Modification Policy)
27+
28+
The `packages/opencode/` submodule is a fork that syncs from upstream every 2 hours. To minimize merge conflicts:
29+
30+
- **Prefer putting new code in `fork-*` packages** (`fork-auth`, `fork-config`, `fork-ui`, `fork-security`, `fork-terminal`, `fork-cli`, `fork-provider`, `fork-tests`). These are ours and never conflict with upstream.
31+
- **Minimize modifications to non-fork packages** (`app`, `opencode`, `sdk`, `ui`, `util`). When changes to upstream code are needed, keep the diff as small as possible — typically just an import and a single function call that delegates to a `fork-*` package.
32+
- **Do not refactor upstream code.** Even if upstream code has bugs or poor patterns, fix only what directly blocks our users. Leave broader cleanups to upstream — they will fix their own bugs over time. Every line we change in upstream files is a potential merge conflict.
33+
- **Tolerate imperfect upstream code.** If an upstream bug doesn't affect our users, leave it alone. If it does affect our users, fix it with the smallest possible diff (inline changes > new imports > new files).
34+
- Use thin re-export shims in upstream packages that delegate to `fork-*` implementations when hooks are needed.
35+
2636
## Key Commands
2737

2838
```bash

CLAUDE.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@ This is a polyglot monorepo with Rust and TypeScript:
2323
- `packages/cli-node/` - Node.js CLI wrapper
2424
- `packages/opencode/` - Git submodule pointing to our fork of the opencode repository. We own this fork and can freely modify, commit, and push changes to it.
2525

26+
## Fork Isolation (Upstream Modification Policy)
27+
28+
The `packages/opencode/` submodule is a fork that syncs from upstream every 2 hours. To minimize merge conflicts:
29+
30+
- **Prefer putting new code in `fork-*` packages** (`fork-auth`, `fork-config`, `fork-ui`, `fork-security`, `fork-terminal`, `fork-cli`, `fork-provider`, `fork-tests`). These are ours and never conflict with upstream.
31+
- **Minimize modifications to non-fork packages** (`app`, `opencode`, `sdk`, `ui`, `util`). When changes to upstream code are needed, keep the diff as small as possible — typically just an import and a single function call that delegates to a `fork-*` package.
32+
- **Do not refactor upstream code.** Even if upstream code has bugs or poor patterns, fix only what directly blocks our users. Leave broader cleanups to upstream — they will fix their own bugs over time. Every line we change in upstream files is a potential merge conflict.
33+
- **Tolerate imperfect upstream code.** If an upstream bug doesn't affect our users, leave it alone. If it does affect our users, fix it with the smallest possible diff (inline changes > new imports > new files).
34+
- Use thin re-export shims in upstream packages that delegate to `fork-*` implementations when hooks are needed.
35+
2636
## Key Commands
2737

2838
```bash

packages/core/src/docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ COPY --chown=opencoder:opencoder packages/opencode /tmp/opencode-local
553553
# Update it by running: ./scripts/update-opencode-commit.sh
554554
RUN set -eux; \
555555
OPENCODE_COMMIT_OVERRIDE="${OPENCODE_COMMIT:-}"; \
556-
OPENCODE_COMMIT="9fd774b0238b11b2d2eb646b2d0122da8689d274"; \
556+
OPENCODE_COMMIT="fc1342c58f7d771f1a82b94403b3baa25c0bbf36"; \
557557
if [ -n "${OPENCODE_COMMIT_OVERRIDE}" ]; then OPENCODE_COMMIT="${OPENCODE_COMMIT_OVERRIDE}"; fi; \
558558
rm -rf /tmp/opencode-repo; \
559559
if [ "${OPENCODE_SOURCE}" = "local" ]; then \

0 commit comments

Comments
 (0)