"))
assertTrue(html.contains(""))
assertTrue(html.contains("
"))
assertTrue(html.contains(""))
@@ -320,22 +265,14 @@ class MdViewTest : BasePlatformTestCase() {
fun `test applyStyle derives markdown colors from editor scheme`() {
val style = customStyle()
- val color = MdCommon.hex(SessionUiStyle.View.Markdown.string())
- val quote = "#445566"
view.applyStyle(style)
- view.set("use `inline` code")
val sheet = view.overrideSheet()
- val html = view.html()
assertTrue(sheet.contains("a { color: #778899"))
- assertTrue(html.contains("inline"))
- assertFalse(html.contains("background: #112233"))
- assertFalse(html.contains("#cc8866"))
+ assertTrue(sheet.contains("code { background: #112233; color: #aabbcc"))
assertTrue(sheet.contains("pre { background: #445566; color: #ddeeff; border-color: #223344"))
- assertTrue(sheet.contains("blockquote { background:"))
- assertTrue(sheet.contains("border-left-color: #223344; color: $quote"))
- assertTrue(sheet.contains("blockquote p { color: $quote"))
+ assertTrue(sheet.contains("blockquote { border-left-color: #223344; color: #334455"))
assertTrue(sheet.contains("th, td { border-color: #223344"))
}
@@ -353,11 +290,10 @@ class MdViewTest : BasePlatformTestCase() {
assertTrue(view.overrideSheet().contains("#ff0077"))
}
- fun `test code bg override does not add inline code background`() {
+ fun `test code bg override appears in override sheet`() {
view.codeBg = Color(0x10, 0x20, 0x30)
view.set("`code`")
- assertFalse(view.overrideSheet().contains("#102030"))
- assertFalse(view.html().contains("#102030"))
+ assertTrue(view.overrideSheet().contains("#102030"))
}
fun `test pre bg and fg overrides appear in override sheet`() {
@@ -373,23 +309,7 @@ class MdViewTest : BasePlatformTestCase() {
fun `test code font override appears in override sheet`() {
view.codeFont = "Fira Code"
view.set("`x`")
- val sheet = view.overrideSheet()
-
- assertTrue(sheet.contains("tt, code, samp, pre, pre code { font-family: 'Fira Code', monospace"))
- assertTrue(sheet.contains("a.kilo-file-ref, code a.kilo-file-ref { color:"))
- assertTrue(sheet.contains("font-family: 'Fira Code', monospace; text-decoration: underline"))
- }
-
- fun `test prose keeps transcript font while inline code uses editor font`() {
- val style = SessionEditorStyle.create(family = "Courier New", size = 21)
-
- view.applyStyle(style)
- view.set("hello `code` packages/opencode/src/session/prompt.ts")
- val sheet = view.overrideSheet()
-
- assertTrue(sheet.contains("body { color:"))
- assertTrue(sheet.contains("font-family: '${style.transcriptFont.name}', sans-serif"))
- assertTrue(sheet.contains("tt, code, samp, pre, pre code { font-family: 'Courier New', monospace"))
+ assertTrue(view.overrideSheet().contains("Fira Code"))
}
fun `test blockquote color overrides appear in override sheet`() {
@@ -578,18 +498,10 @@ class MdViewTest : BasePlatformTestCase() {
DefaultLanguageHighlighterColors.DOC_COMMENT,
TextAttributes(Color(0x33, 0x44, 0x55), null, null, null, Font.PLAIN),
)
- scheme.setAttributes(
- DefaultLanguageHighlighterColors.LINE_COMMENT,
- TextAttributes(Color(0x44, 0x55, 0x66), null, null, null, Font.PLAIN),
- )
scheme.setAttributes(
DefaultLanguageHighlighterColors.DOC_CODE_INLINE,
TextAttributes(Color(0xAA, 0xBB, 0xCC), Color(0x11, 0x22, 0x33), null, null, Font.PLAIN),
)
- scheme.setAttributes(
- DefaultLanguageHighlighterColors.STRING,
- TextAttributes(Color(0xCC, 0x88, 0x66), null, null, null, Font.PLAIN),
- )
scheme.setAttributes(
DefaultLanguageHighlighterColors.DOC_CODE_BLOCK,
TextAttributes(Color(0xDD, 0xEE, 0xFF), Color(0x44, 0x55, 0x66), null, null, Font.PLAIN),
diff --git a/packages/opencode/test/session/prompt.test.ts b/packages/opencode/test/session/prompt.test.ts
index db4219ca6b..9229c64944 100644
--- a/packages/opencode/test/session/prompt.test.ts
+++ b/packages/opencode/test/session/prompt.test.ts
@@ -346,18 +346,20 @@ const useServerConfig = Effect.fn("test.useServerConfig")(function* (config: (ur
return { dir, llm }
})
-// kilocode_change start - wait for the runner state that cancel observes instead of session status
+// Wait for a session's runner to enter a busy state. SessionStatus is flipped to
+// "busy" inside Runner.startShell's modifyEffect at the same moment the runner
+// is registered, so this is a deterministic readiness signal — cancel can't
+// no-op once we observe it.
const waitForBusy = (sessionID: SessionID, duration: Duration.Input = "2 seconds") =>
pollWithTimeout(
Effect.gen(function* () {
- const run = yield* SessionRunState.Service
- const exit = yield* run.assertNotBusy(sessionID).pipe(Effect.exit)
- return Exit.isFailure(exit) ? (true as const) : undefined
+ const status = yield* SessionStatus.Service
+ const s = yield* status.get(sessionID)
+ return s.type === "busy" ? (true as const) : undefined
}),
`session ${sessionID} never became busy`,
duration,
)
-// kilocode_change end
const hasBash = Effect.sync(() => Bun.which("bash") !== null)