logancyang_obsidian-copilot/src
Zero Liu 8d92e2d331
fix(agent-mode): coalesce streamed prose split by an invisible trail part
A streamed agent message renders each `text` part as its own block-level
markdown div, so when a top-level-invisible part — a hidden ToolSearch, an
empty plan, or a concurrent background sub-agent's event — lands between two
prose deltas, one sentence splits into two stacked blocks and shows a spurious
mid-sentence line break in the live UI. The saved markdown, built from the flat
`displayText` (deltas concatenated with no separator), has no break, so the
artifact is render-only and self-heals on reload.

Add a shared `isTopLevelInvisible` predicate and apply it across all three
consumers of the parts stream:
- `foldNodes` skips empty plans and coalesces adjacent text nodes, so the live
  trail matches the saved `displayText`.
- `agentResponseText` derives from the folded trail, so Copy/Insert no longer
  injects a blank line into a split sentence (a visible tool card / reasoning /
  non-empty plan between prose still yields a real `\n\n` break).
- `splitTrailingText` treats invisible parts as transparent and the collapsed
  "Worked for X" view renders the final run as one block, so the collapse can't
  strand half a sentence in the hidden research.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 00:15:14 +08:00
..
__tests__ chore(types): tighten types and replace TFile/TFolder casts (W1/9) (#2403) 2026-05-12 16:18:22 -07:00
agentMode fix(agent-mode): coalesce streamed prose split by an invisible trail part 2026-07-01 00:15:14 +08:00
cache Enforce no-global-app via ESLint and fix all violations (#2533) 2026-05-30 14:52:46 -07:00
commands feat(entitlement): gate multi-agent to Plus tier via signed entitlement token (#2644) 2026-06-29 19:56:00 -07:00
components feat(entitlement): gate multi-agent to Plus tier via signed entitlement token (#2644) 2026-06-29 19:56:00 -07:00
context feat(agent-projects): project-scoped Agent Mode — Agent Home PR2 (#2604) 2026-06-28 00:33:22 -07:00
contexts Add BYOK settings modal 2026-05-28 16:00:38 -07:00
core feat(settings): rename autosave label to 'Autosave Chat as Markdown' and always generate AI titles on save (#2593) 2026-06-10 22:54:13 -07:00
editor chore(deps): remove unused deps and dead code to shrink bundle (#2460) 2026-05-14 22:25:59 -07:00
entitlement feat(entitlement): gate multi-agent to Plus tier via signed entitlement token (#2644) 2026-06-29 19:56:00 -07:00
hooks feat(agent-projects): project-scoped Agent Mode — Agent Home PR2 (#2604) 2026-06-28 00:33:22 -07:00
imageProcessing Improve custom command (#1942) 2025-10-20 17:52:50 -07:00
integration_tests Enforce no-global-app via ESLint and fix all violations (#2533) 2026-05-30 14:52:46 -07:00
lib feat(agent-home): segmented-tab shelf, aligned rows, top-anchored composer (#2550) 2026-06-06 13:01:24 -07:00
LLMProviders feat(entitlement): gate multi-agent to Plus tier via signed entitlement token (#2644) 2026-06-29 19:56:00 -07:00
memory Enforce no-global-app via ESLint and fix all violations (#2533) 2026-05-30 14:52:46 -07:00
mentions feat(agent-projects): project-scoped Agent Mode — Agent Home PR2 (#2604) 2026-06-28 00:33:22 -07:00
miyo fix(mobile): keep Agent Mode off the emulated-mobile load path (#2587) 2026-06-10 14:18:30 +08:00
modelManagement feat(entitlement): gate multi-agent to Plus tier via signed entitlement token (#2644) 2026-06-29 19:56:00 -07:00
projects feat(agent-projects): project-scoped Agent Mode — Agent Home PR2 (#2604) 2026-06-28 00:33:22 -07:00
search feat(agent-projects): project-scoped Agent Mode — Agent Home PR2 (#2604) 2026-06-28 00:33:22 -07:00
services fix(mobile): keep Agent Mode off the emulated-mobile load path (#2587) 2026-06-10 14:18:30 +08:00
settings feat(entitlement): gate multi-agent to Plus tier via signed entitlement token (#2644) 2026-06-29 19:56:00 -07:00
state Enforce no-global-app via ESLint and fix all violations (#2533) 2026-05-30 14:52:46 -07:00
styles Remove unnecessary chat bottom padding calculation (#2585) 2026-06-08 12:47:43 -07:00
system-prompts feat(agent-projects): project-scoped Agent Mode — Agent Home PR2 (#2604) 2026-06-28 00:33:22 -07:00
tests feat(entitlement): gate multi-agent to Plus tier via signed entitlement token (#2644) 2026-06-29 19:56:00 -07:00
tools fix(tools): remove zod transforms that break autonomous agent tool binding (#2551) 2026-06-03 05:56:57 +08:00
types feat(agent-mode): introduce Agent Mode feature 2026-05-20 19:05:41 -07:00
utils feat(model-management): add DeepInfra Copilot Plus models, default off (#2645) 2026-06-29 18:52:44 -07:00
aiParams.ts feat(agent-projects): project-scoped Agent Mode — Agent Home PR2 (#2604) 2026-06-28 00:33:22 -07:00
chainType.ts chore(lint): enable obsidianmd/rule-custom-message and fix violations (#2416) 2026-05-13 01:39:35 -07:00
chainUtils.ts fix: defense-in-depth overrides to prevent tiktoken CDN timeout in Plus mode (#2283) 2026-03-13 21:48:13 -07:00
chatUtils.toolMarkers.test.ts chore(test): type test mocks to satisfy @typescript-eslint/no-unsafe-call (#2435) 2026-05-13 23:17:30 -07:00
chatUtils.ts Implement modular context compaction architecture (#2159) 2026-02-06 21:52:33 -08:00
composerUtils.ts chore(deps): remove unused deps and dead code to shrink bundle (#2460) 2026-05-14 22:25:59 -07:00
constants.ts feat(entitlement): gate multi-agent to Plus tier via signed entitlement token (#2644) 2026-06-29 19:56:00 -07:00
context.ts feat(agent-mode): auto-focus chat input when the agent view opens or activates (#2564) 2026-06-05 09:11:00 +08:00
contextProcessor.dataview.test.ts Enforce no-global-app via ESLint and fix all violations (#2533) 2026-05-30 14:52:46 -07:00
contextProcessor.embeds.test.ts Enforce no-global-app via ESLint and fix all violations (#2533) 2026-05-30 14:52:46 -07:00
contextProcessor.selectedText.test.ts Enforce no-global-app via ESLint and fix all violations (#2533) 2026-05-30 14:52:46 -07:00
contextProcessor.ts Enforce no-global-app via ESLint and fix all violations (#2533) 2026-05-30 14:52:46 -07:00
encryptionService.test.ts chore(react): centralize React root creation via createPluginRoot helper (#2467) 2026-05-15 11:49:03 -07:00
encryptionService.ts fix(mobile): keep Agent Mode off the emulated-mobile load path (#2587) 2026-06-10 14:18:30 +08:00
error.ts chore(deps): remove unused deps and dead code to shrink bundle (#2460) 2026-05-14 22:25:59 -07:00
errorFormat.ts chore(eslint): enable no-explicit-any; fix ~395 violations (#2452) 2026-05-14 02:08:45 -07:00
langchainStream.test.ts chore(eslint): enable @typescript-eslint/no-unsafe-argument and fix violations (#2440) 2026-05-13 21:40:26 -07:00
langchainStream.ts feat: Improve error handling architecture across chain runners. (#1931) 2025-10-23 17:00:23 -07:00
logFileManager.ts Enforce no-global-app via ESLint and fix all violations (#2533) 2026-05-30 14:52:46 -07:00
logger.ts chore(eslint): enable @typescript-eslint/no-unsafe-argument and fix violations (#2440) 2026-05-13 21:40:26 -07:00
main.ts feat(entitlement): gate multi-agent to Plus tier via signed entitlement token (#2644) 2026-06-29 19:56:00 -07:00
noteUtils.ts Enforce no-global-app via ESLint and fix all violations (#2533) 2026-05-30 14:52:46 -07:00
plusUtils.test.ts feat(entitlement): gate multi-agent to Plus tier via signed entitlement token (#2644) 2026-06-29 19:56:00 -07:00
plusUtils.ts feat(entitlement): gate multi-agent to Plus tier via signed entitlement token (#2644) 2026-06-29 19:56:00 -07:00
rateLimiter.ts chore(popout): window-global API swaps — timers, globalThis, base64 (W3/9) (#2401) 2026-05-12 22:24:17 -07:00
types.ts feat(keychain): migrate API key storage to Obsidian Keychain (#2364) 2026-05-14 13:57:21 -07:00
utils.cleanMessageForCopy.test.ts Composer V2: Replace replaceInFile with editFile as the primary targeted-edit tool (#2305) 2026-03-17 18:51:39 +09:00
utils.test.ts Enforce no-global-app via ESLint and fix all violations (#2533) 2026-05-30 14:52:46 -07:00
utils.ts feat(model-management): add DeepInfra Copilot Plus models, default off (#2645) 2026-06-29 18:52:44 -07:00