Skip to content

Commit 291e168

Browse files
committed
Merge remote-tracking branch 'upstream/dev' into fix/clock-skew-prompt-loop-exit
# Conflicts: # packages/opencode/src/session/prompt.ts
2 parents 21e7f3f + 24bdd3c commit 291e168

File tree

278 files changed

+10678
-5952
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

278 files changed

+10678
-5952
lines changed

.github/workflows/test.yml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ concurrency:
1515

1616
permissions:
1717
contents: read
18+
checks: write
1819

1920
jobs:
2021
unit:
@@ -45,8 +46,39 @@ jobs:
4546
git config --global user.email "bot@opencode.ai"
4647
git config --global user.name "opencode"
4748
49+
- name: Cache Turbo
50+
uses: actions/cache@v4
51+
with:
52+
path: node_modules/.cache/turbo
53+
key: turbo-${{ runner.os }}-${{ hashFiles('turbo.json', '**/package.json') }}-${{ github.sha }}
54+
restore-keys: |
55+
turbo-${{ runner.os }}-${{ hashFiles('turbo.json', '**/package.json') }}-
56+
turbo-${{ runner.os }}-
57+
4858
- name: Run unit tests
49-
run: bun turbo test
59+
run: bun turbo test:ci
60+
env:
61+
OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER: ${{ runner.os == 'Windows' && 'true' || 'false' }}
62+
63+
- name: Publish unit reports
64+
if: always()
65+
uses: mikepenz/action-junit-report@v6
66+
with:
67+
report_paths: packages/*/.artifacts/unit/junit.xml
68+
check_name: "unit results (${{ matrix.settings.name }})"
69+
detailed_summary: true
70+
include_time_in_summary: true
71+
fail_on_failure: false
72+
73+
- name: Upload unit artifacts
74+
if: always()
75+
uses: actions/upload-artifact@v4
76+
with:
77+
name: unit-${{ matrix.settings.name }}-${{ github.run_attempt }}
78+
include-hidden-files: true
79+
if-no-files-found: ignore
80+
retention-days: 7
81+
path: packages/*/.artifacts/unit/junit.xml
5082

5183
e2e:
5284
name: e2e (${{ matrix.settings.name }})
@@ -100,15 +132,17 @@ jobs:
100132
run: bun --cwd packages/app test:e2e:local
101133
env:
102134
CI: true
135+
PLAYWRIGHT_JUNIT_OUTPUT: e2e/junit-${{ matrix.settings.name }}.xml
103136
timeout-minutes: 30
104137

105138
- name: Upload Playwright artifacts
106-
if: failure()
139+
if: always()
107140
uses: actions/upload-artifact@v4
108141
with:
109142
name: playwright-${{ matrix.settings.name }}-${{ github.run_attempt }}
110143
if-no-files-found: ignore
111144
retention-days: 7
112145
path: |
146+
packages/app/e2e/junit-*.xml
113147
packages/app/e2e/test-results
114148
packages/app/e2e/playwright-report

.opencode/plugins/tui-smoke.tsx

Lines changed: 53 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -653,31 +653,77 @@ const home = (api: TuiPluginApi, input: Cfg) => ({
653653
const skin = look(ctx.theme.current)
654654
type Prompt = (props: {
655655
workspaceID?: string
656+
visible?: boolean
657+
disabled?: boolean
658+
onSubmit?: () => void
656659
hint?: JSX.Element
660+
right?: JSX.Element
661+
showPlaceholder?: boolean
657662
placeholders?: {
658663
normal?: string[]
659664
shell?: string[]
660665
}
661666
}) => JSX.Element
662-
if (!("Prompt" in api.ui)) return null
663-
const view = api.ui.Prompt
664-
if (typeof view !== "function") return null
665-
const Prompt = view as Prompt
667+
type Slot = (
668+
props: { name: string; mode?: unknown; children?: JSX.Element } & Record<string, unknown>,
669+
) => JSX.Element | null
670+
const ui = api.ui as TuiPluginApi["ui"] & { Prompt: Prompt; Slot: Slot }
671+
const Prompt = ui.Prompt
672+
const Slot = ui.Slot
666673
const normal = [
667674
`[SMOKE] route check for ${input.label}`,
668675
"[SMOKE] confirm home_prompt slot override",
669-
"[SMOKE] verify api.ui.Prompt rendering",
676+
"[SMOKE] verify prompt-right slot passthrough",
670677
]
671678
const shell = ["printf '[SMOKE] home prompt\n'", "git status --short", "bun --version"]
672-
const Hint = (
679+
const hint = (
673680
<box flexShrink={0} flexDirection="row" gap={1}>
674681
<text fg={skin.muted}>
675682
<span style={{ fg: skin.accent }}></span> smoke home prompt
676683
</text>
677684
</box>
678685
)
679686

680-
return <Prompt workspaceID={value.workspace_id} hint={Hint} placeholders={{ normal, shell }} />
687+
return (
688+
<Prompt
689+
workspaceID={value.workspace_id}
690+
hint={hint}
691+
right={
692+
<box flexDirection="row" gap={1}>
693+
<Slot name="home_prompt_right" workspace_id={value.workspace_id} />
694+
<Slot name="smoke_prompt_right" workspace_id={value.workspace_id} label={input.label} />
695+
</box>
696+
}
697+
placeholders={{ normal, shell }}
698+
/>
699+
)
700+
},
701+
home_prompt_right(ctx, value) {
702+
const skin = look(ctx.theme.current)
703+
const id = value.workspace_id?.slice(0, 8) ?? "none"
704+
return (
705+
<text fg={skin.muted}>
706+
<span style={{ fg: skin.accent }}>{input.label}</span> home:{id}
707+
</text>
708+
)
709+
},
710+
session_prompt_right(ctx, value) {
711+
const skin = look(ctx.theme.current)
712+
return (
713+
<text fg={skin.muted}>
714+
<span style={{ fg: skin.accent }}>{input.label}</span> session:{value.session_id.slice(0, 8)}
715+
</text>
716+
)
717+
},
718+
smoke_prompt_right(ctx, value) {
719+
const skin = look(ctx.theme.current)
720+
const id = typeof value.workspace_id === "string" ? value.workspace_id.slice(0, 8) : "none"
721+
const label = typeof value.label === "string" ? value.label : input.label
722+
return (
723+
<text fg={skin.muted}>
724+
<span style={{ fg: skin.accent }}>{label}</span> custom:{id}
725+
</text>
726+
)
681727
},
682728
home_bottom(ctx) {
683729
const skin = look(ctx.theme.current)

0 commit comments

Comments
 (0)