Fill OpenCode subagent info: task, type, model, and tokens (#2909)
* feat(opencode): fill subagent descriptor with task, type, model, and tokens OpenCode subagent rows rendered with no information: the initial upsert carried only the child session title and status, so the track showed a bare title with an empty second line and the pane tab fell back to "Subagent". Fill the same provider-agnostic descriptor fields Claude populates since #2498, from data OpenCode already emits: - description <- the task tool call's description input (fallback: the child session title), so the task names the row - title <- subagent_type from the task call, else the session's agent - toolCallId <- the parent task tool call id - subtitle <- "agent · model · Variant · Nk tokens", folded from the child's own session record and assistant frames, deduped per child Facts are never inherited from the parent; absent facts render as nothing. Presentation upserts omit status so a late subtitle update cannot revert a finished child (the store's sticky contract). Both task-link orderings are handled, and the hydration path derives the same facts for historical children so restored sessions match live. Server-side only; no protocol or app changes. * fix(opencode): emit subagent type as descriptor title from assistant frames * feat(app): show subagent info line in the provider subagent pane * polish: address subagent presentation review nits * fix(opencode): link subagents from task metadata Current OpenCode task results identify their child session in tool metadata rather than the legacy textual output. Preserve that boundary field so parallel task calls retain the correct description, type, and tool-call association. --------- Co-authored-by: Mohamed Boudra <boudra.moha@gmail.com>
This commit is contained in:
co-authored by
Mohamed Boudra
parent
e1b4058b77
commit
5465d66edd
@@ -141,6 +141,7 @@ function ProviderSubagentPanel() {
|
||||
const firstTimelineSeq = timeline?.rows.size ? Math.min(...timeline.rows.keys()) : null;
|
||||
const progressKey =
|
||||
timeline?.epoch && firstTimelineSeq !== null ? `${timeline.epoch}:${firstTimelineSeq}` : null;
|
||||
const subtitle = descriptor?.subtitle?.trim();
|
||||
|
||||
const streamContext = useMemo<AgentScreenAgent>(
|
||||
() => ({
|
||||
@@ -183,6 +184,17 @@ function ProviderSubagentPanel() {
|
||||
|
||||
return (
|
||||
<View style={styles.container} testID="provider-subagent-panel">
|
||||
{subtitle ? (
|
||||
<View style={styles.subtitleHeader}>
|
||||
<Text
|
||||
style={styles.subtitleText}
|
||||
numberOfLines={1}
|
||||
testID="provider-subagent-pane-subtitle"
|
||||
>
|
||||
{subtitle}
|
||||
</Text>
|
||||
</View>
|
||||
) : null}
|
||||
<AgentStreamView
|
||||
agentId={streamId}
|
||||
serverId={serverId}
|
||||
@@ -201,7 +213,17 @@ function ProviderSubagentPanel() {
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create((theme) => ({
|
||||
container: { flex: 1 },
|
||||
container: { flex: 1, minHeight: 0 },
|
||||
subtitleHeader: {
|
||||
paddingHorizontal: theme.spacing[3],
|
||||
paddingVertical: theme.spacing[1],
|
||||
borderBottomWidth: theme.borderWidth[1],
|
||||
borderBottomColor: theme.colors.border,
|
||||
},
|
||||
subtitleText: {
|
||||
color: theme.colors.foregroundMuted,
|
||||
fontSize: theme.fontSize.xs,
|
||||
},
|
||||
unsupported: { flex: 1, alignItems: "center", justifyContent: "center", padding: 24 },
|
||||
unsupportedText: { color: theme.colors.foregroundMuted, textAlign: "center" },
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user