Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ like `## [0.4.16] - 2026-10-24`.
- A picture too large for the model no longer fails the chat or a subagent through CLIProxyAPI: on the OpenAI-compatible wire, as on the Anthropic one, an image over 8000 px a side goes as a note, and for Claude, once a request holds more than 20 images and PDFs, so does one over 3000 px. The stored history keeps the picture. A remaining "image dimensions exceed max allowed size" 400 drops the picture and retries instead of falling back to another model. A full-page browser screenshot of a page wider than 7900 px stops at 7900 px.
- Windows: commands work on PCs without Git Bash, using cmd.exe batch scripts. Quoted paths, multiline blocks, percent variables, exit codes and working-directory changes stay intact; command timeouts stop the process tree.
- The agent is told the device's actual execution shell and Windows command syntax instead of assuming Unix commands.
- Android: opening a very big chat (a 90 MB transcript full of screenshots) no longer crashes the app. It reads the newest 200 messages with large blocks left out, the same paged API as the web, and reads older pages as you scroll to the top. A picture or document a page left out is read from the hub when it shows or when Edit or Retry sends it again, and chat images are decoded at about the size they show.

## [0.4.104] - 2026-11-19

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import androidx.compose.foundation.layout.offset
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.LazyListState
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.material.icons.Icons
Expand Down Expand Up @@ -46,7 +47,9 @@ import androidx.compose.runtime.key
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.rememberUpdatedState
import androidx.compose.runtime.setValue
import androidx.compose.runtime.snapshotFlow
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
Expand Down Expand Up @@ -219,6 +222,7 @@ fun ChatScreen(
val context = LocalContext.current
val scope = rememberCoroutineScope()
val listState = rememberLazyListState()
OlderOnTop(listState, vm::loadOlder)

var actionsFor by remember { mutableStateOf<Message?>(null) }
var pickFor by remember { mutableStateOf<Pair<PickFor, Message?>?>(null) }
Expand Down Expand Up @@ -784,3 +788,17 @@ private fun MessageActionsSheet(
}
}

/**
* Near the top of what a transcript holds (a reversed list, so its last
* items): [load] reads the page before it. The count asks again after each
* page lands, so a page that fits the screen still reads the next one.
*/
@Composable
internal fun OlderOnTop(state: LazyListState, load: () -> Unit) {
val current by rememberUpdatedState(load)
LaunchedEffect(state) {
snapshotFlow { state.layoutInfo.run { totalItemsCount.takeIf { it > 0 && (visibleItemsInfo.lastOrNull()?.index ?: 0) >= it - 3 } } }
.collect { if (it != null) current() }
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import dev.conclave.client.moveToHub
import dev.conclave.client.workflowRuns
import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.SharingStarted
import kotlinx.coroutines.flow.StateFlow
Expand Down Expand Up @@ -145,8 +146,9 @@ class ChatViewModel(hub: HubRepository, val sessionId: String, drafts: DraftStor
val after = if (quiet) TranscriptReducer.reloadAfter(transcript.value) else null
val askedAt = System.currentTimeMillis()
val version = transcript.value.queueVersion
val msgs = hub.api { it.messages(sessionId, afterSeq = after) }
transcript.update { TranscriptReducer.merge(it, msgs) }
// the newest page, light (a 90 MB chat of screenshots ended the app); older pages come on scroll (loadOlder)
val msgs = hub.api { it.messages(sessionId, afterSeq = after, limit = if (after == null) TranscriptReducer.PAGE else null, trim = true) }
transcript.update { TranscriptReducer.loaded(it, msgs, paged = after == null) }
// what waits while it works; a hub from before the queue has none to say
runCatching { hub.api { it.queue(sessionId) } }.getOrNull()?.let { list ->
transcript.update { TranscriptReducer.loadedQueue(it, list, askedAt, version) }
Expand Down Expand Up @@ -174,6 +176,18 @@ class ChatViewModel(hub: HubRepository, val sessionId: String, drafts: DraftStor
}
}

private var olderLoad: Job? = null

/** Scrolled to the top: the page before the first message held, one read at a time. */
fun loadOlder() {
if (olderLoad?.isActive == true) return
val before = TranscriptReducer.olderBefore(transcript.value) ?: return
olderLoad = action {
val page = hub.api { it.messages(sessionId, beforeSeq = before, limit = TranscriptReducer.PAGE, trim = true) }
transcript.update { TranscriptReducer.olderPage(it, page) }
}
}

/** Open here: a reply that came clears its bold title in the lists, on the hub so the web agrees (logic/Unread.kt). */
private fun seen(s: Session) {
if (!Unread.isUnread(s)) return
Expand Down Expand Up @@ -453,12 +467,14 @@ class ChatViewModel(hub: HubRepository, val sessionId: String, drafts: DraftStor
}

private suspend fun retryFrom(user: Message) {
// before the rewind: a file a trimmed page left out is read from the message the rewind drops
val files = attachmentsOf(hub, user)
if (running.value) hub.api { it.abort(sessionId) }
// the hub keeps messages up to the seq it is given and drops the rest
_session.value = hub.api { it.rewind(sessionId, user.seq - 1) }
transcript.value = Transcript(sessionId)
load(quiet = true)
hub.api { it.send(sessionId, SendInput(text = user.content.visibleText(), attachments = attachmentsOf(user).ifEmpty { null })) }
hub.api { it.send(sessionId, SendInput(text = user.content.visibleText(), attachments = files.ifEmpty { null })) }
}

/** The refused reply sent to the next model: its button reads "Trying" until the hub drops the reply. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
package dev.conclave.app.ui.chat

import dev.conclave.client.model.isReminder
import android.graphics.BitmapFactory
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
Expand Down Expand Up @@ -63,18 +62,21 @@ import androidx.compose.ui.draw.drawBehind
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.geometry.Size
import androidx.compose.ui.graphics.ImageBitmap
import androidx.compose.ui.graphics.asImageBitmap
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import androidx.compose.ui.platform.LocalDensity
import dev.conclave.app.ui.common.LocalAppContainer
import dev.conclave.app.ui.common.MarkdownText
import dev.conclave.app.ui.common.ModelMark
import dev.conclave.app.ui.common.ModelName
import dev.conclave.app.ui.common.rememberNow
import dev.conclave.app.ui.conversation.ChatProse
import dev.conclave.app.ui.conversation.FullImage
import dev.conclave.app.ui.conversation.decodeScaled
import dev.conclave.app.ui.conversation.imageData
import dev.conclave.app.ui.conversation.LocalSessionWork
import dev.conclave.app.ui.conversation.SessionWork
import dev.conclave.app.ui.conversation.TurnWork
Expand Down Expand Up @@ -109,7 +111,6 @@ import dev.conclave.client.model.plainText
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import java.util.Base64

/**
* Your message in a session (MOBILE-V2 5): right aligned in a bubble of
Expand Down Expand Up @@ -518,18 +519,11 @@ fun SummaryLine(message: Message) {

@Composable
fun InlineImage(block: ImageBlock) {
val data = block.data
val bitmap by produceState<ImageBitmap?>(null, data) {
value = if (data.isNullOrBlank()) {
null
} else {
withContext(Dispatchers.Default) {
runCatching {
val bytes = Base64.getDecoder().decode(data)
BitmapFactory.decodeByteArray(bytes, 0, bytes.size)?.asImageBitmap()
}.getOrNull()
}
}
val hub = LocalAppContainer.current.hub
// decoded at about the size it shows, not full size; one a trimmed page left out is read from the hub now
val target = with(LocalDensity.current) { 560.dp.roundToPx() }
val bitmap by produceState<ImageBitmap?>(null, block, target) {
value = withContext(Dispatchers.Default) { hub.imageData(block)?.let { decodeScaled(it, target) } }
}
val img = bitmap
var shown by remember { mutableStateOf(false) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ import androidx.lifecycle.viewmodel.compose.viewModel
import dev.conclave.app.ui.chat.ApprovalPrompt
import dev.conclave.app.ui.chat.NotesStrip
import dev.conclave.app.ui.chat.NotesViewModel
import dev.conclave.app.ui.chat.OlderOnTop
import dev.conclave.app.ui.chat.QuestionPrompt
import dev.conclave.app.ui.common.ConfirmDialog
import dev.conclave.app.ui.common.ErrorBanner
Expand Down Expand Up @@ -320,6 +321,7 @@ fun ChatThreadScreen(
}

val listState = rememberLazyListState()
OlderOnTop(listState, vm::loadOlder)
val reduced = reducedMotion()
// sending brings you back to the bottom
LaunchedEffect(pending?.at) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ import dev.conclave.client.model.ThinkingLevel
import dev.conclave.client.model.visibleText
import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.SharingStarted
Expand Down Expand Up @@ -146,11 +147,11 @@ internal object ChatStarts {
fun done(key: String) = _all.update { it - key }
}

/** The attachments a message was sent with, so Edit and Retry send them again. */
fun attachmentsOf(m: Message): List<Attachment> = m.content.mapNotNull { b ->
/** The attachments a message was sent with, so Edit and Retry send them again; one a trimmed page left out is read from the hub. */
suspend fun attachmentsOf(hub: HubRepository, m: Message): List<Attachment> = m.content.mapNotNull { b ->
when (b) {
is ImageBlock -> b.data?.let { Attachment(mediaType = b.mediaType, data = it, name = "image") }
is DocumentBlock -> b.data?.let { Attachment(mediaType = b.mediaType, data = it, name = b.title ?: "document") }
is ImageBlock -> hub.blockData(b.data, b.url)?.let { Attachment(mediaType = b.mediaType, data = it, name = "image") }
is DocumentBlock -> hub.blockData(b.data, b.url)?.let { Attachment(mediaType = b.mediaType, data = it, name = b.title ?: "document") }
else -> null
}
}
Expand Down Expand Up @@ -351,8 +352,9 @@ class ChatThreadViewModel(
val after = if (quiet) TranscriptReducer.reloadAfter(transcript.value) else null
val askedAt = System.currentTimeMillis()
val version = transcript.value.queueVersion
val msgs = hub.api { it.messages(sessionId, afterSeq = after) }
transcript.update { TranscriptReducer.merge(it, msgs) }
// the newest page, light (a 90 MB chat of screenshots ended the app); older pages come on scroll (loadOlder)
val msgs = hub.api { it.messages(sessionId, afterSeq = after, limit = if (after == null) TranscriptReducer.PAGE else null, trim = true) }
transcript.update { TranscriptReducer.loaded(it, msgs, paged = after == null) }
// what waits behind the reply; a hub from before the queue has none to say
runCatching { hub.api { it.queue(sessionId) } }.getOrNull()?.let { list ->
transcript.update { TranscriptReducer.loadedQueue(it, list, askedAt, version) }
Expand Down Expand Up @@ -407,6 +409,18 @@ class ChatThreadViewModel(

private fun knownIds(): Set<String> = transcript.value.messages.map { it.id }.toSet()

private var olderLoad: Job? = null

/** Scrolled to the top: the page before the first message held, one read at a time. */
fun loadOlder() {
if (olderLoad?.isActive == true) return
val before = TranscriptReducer.olderBefore(transcript.value) ?: return
olderLoad = action {
val page = hub.api { it.messages(sessionId, beforeSeq = before, limit = TranscriptReducer.PAGE, trim = true) }
transcript.update { TranscriptReducer.olderPage(it, page) }
}
}

/** Sends the draft. While a reply runs it queues: it shows at once, Queued, and goes out when that reply ends. */
fun send() = send(loss = null)

Expand Down Expand Up @@ -552,8 +566,8 @@ class ChatThreadViewModel(
val s = hub.api { it.rewind(sessionId, from.seq - 1) }
rewound = true
onSession(s)
val msgs = hub.api { it.messages(sessionId) }
transcript.value = TranscriptReducer.merge(Transcript(sessionId), msgs)
val msgs = hub.api { it.messages(sessionId, limit = TranscriptReducer.PAGE, trim = true) }
transcript.value = TranscriptReducer.loaded(Transcript(sessionId), msgs, paged = true)
hidden.value = emptySet()
hub.api { it.send(sessionId, SendInput(text = text, attachments = files.ifEmpty { null })) }
} catch (e: CancellationException) {
Expand Down Expand Up @@ -593,11 +607,11 @@ class ChatThreadViewModel(
return@launch
}
}
replaceFrom(user, user.content.visibleText(), attachmentsOf(user))
action { replaceFrom(user, user.content.visibleText(), attachmentsOf(hub, user)) }
}
}

fun edit(message: Message, text: String) = replaceFrom(message, text.trim(), attachmentsOf(message))
fun edit(message: Message, text: String) = action { replaceFrom(message, text.trim(), attachmentsOf(hub, message)) }

/** Retry after a failure: send your last message again. */
fun retryLast() {
Expand All @@ -606,7 +620,7 @@ class ChatThreadViewModel(
return
}
val user = transcript.value.messages.lastOrNull { it.role == Role.USER && it.kind == MessageKind.NORMAL && !ChatItems.isToolResultsOnly(it) && !AgentResults.isContextOnly(it) } ?: return
replaceFrom(user, user.content.visibleText(), attachmentsOf(user))
action { replaceFrom(user, user.content.visibleText(), attachmentsOf(hub, user)) }
}

/** The refused reply sent to the next model: its button reads "Trying" until the hub drops the reply. */
Expand Down
Loading
Loading