@@ -3,11 +3,6 @@ import { Notice } from 'obsidian';
33import { hasErrorContentBlock } from '../../../core/chat/error-blocks' ;
44import { detectBuiltInCommand } from '../../../core/commands/built-in-commands' ;
55import type { BrowserSelectionContext , CanvasSelectionContext } from '../../../core/context/types' ;
6- import {
7- logElapsed ,
8- measure ,
9- measureAsync ,
10- } from '../../../core/diagnostics/performance' ;
116import type { EditorSelectionContext } from '../../../core/editor/editor-context' ;
127import type { ChatRuntime } from '../../../core/runtime/chat-runtime' ;
138import type { ApprovalCallbackOptions , ChatTurnRequest } from '../../../core/runtime/types' ;
@@ -282,13 +277,13 @@ export class InputController {
282277 displayContent : content ,
283278 turnRequest : cloneChatTurnRequest ( options . turnRequestOverride ) ,
284279 }
285- : await measureAsync ( 'turn.buildSubmission' , ( ) => this . buildTurnSubmission ( {
280+ : await this . buildTurnSubmission ( {
286281 content,
287282 images : imagesForMessage ,
288283 editorContextOverride : options ?. editorContextOverride ,
289284 browserContextOverride : options ?. browserContextOverride ,
290285 canvasContextOverride : options ?. canvasContextOverride ,
291- } ) ) ;
286+ } ) ;
292287 const { displayContent, turnRequest } = turnSubmission ;
293288
294289 fileContextManager ?. markCurrentNoteSent ( ) ;
@@ -305,7 +300,7 @@ export class InputController {
305300 state . hasPendingConversationSave = true ;
306301 renderer . addMessage ( userMsg ) ;
307302
308- await measureAsync ( 'turn.titleGeneration' , ( ) => this . triggerTitleGeneration ( ) ) ;
303+ await this . triggerTitleGeneration ( ) ;
309304
310305 const assistantMsg : ChatMessage = {
311306 id : this . deps . generateId ( ) ,
@@ -330,9 +325,6 @@ export class InputController {
330325 isCompact ? 'qoderian-thinking--compact' : undefined ,
331326 ) ;
332327 state . responseStartTime = performance . now ( ) ;
333- // Turn-level timing origin for the [qoderian perf] turn.* diagnostics.
334- const turnStartedAt = state . responseStartTime ;
335- let sawFirstRuntimeChunk = false ;
336328
337329 let wasInterrupted = false ;
338330 let wasInvalidated = false ;
@@ -341,7 +333,7 @@ export class InputController {
341333
342334 // Lazy initialization: ensure service is ready before first query
343335 if ( this . deps . ensureServiceInitialized ) {
344- const ready = await measureAsync ( 'turn.serviceInit' , ( ) => this . deps . ensureServiceInitialized ! ( ) ) ;
336+ const ready = await this . deps . ensureServiceInitialized ( ) ;
345337 if ( ! ready ) {
346338 new Notice ( 'Failed to initialize agent service. Please try again.' ) ;
347339 streamController . hideThinkingIndicator ( ) ;
@@ -384,7 +376,7 @@ export class InputController {
384376 }
385377
386378 try {
387- const preparedTurn = measure ( 'turn.prepareTurn' , ( ) => agentService . prepareTurn ( turnRequest ) ) ;
379+ const preparedTurn = agentService . prepareTurn ( turnRequest ) ;
388380 userMsg . content = preparedTurn . persistedContent ;
389381 userMsg . currentNote = preparedTurn . isCompact
390382 ? undefined
@@ -394,10 +386,6 @@ export class InputController {
394386 // This prevents duplication when rebuilding context for new sessions
395387 const previousMessages = state . messages . slice ( 0 , - 2 ) ;
396388 for await ( const chunk of agentService . query ( preparedTurn , previousMessages ) ) {
397- if ( ! sawFirstRuntimeChunk ) {
398- sawFirstRuntimeChunk = true ;
399- logElapsed ( 'turn.firstChunk' , turnStartedAt ) ;
400- }
401389 if ( state . streamGeneration !== streamGeneration ) {
402390 wasInvalidated = true ;
403391 break ;
@@ -428,7 +416,6 @@ export class InputController {
428416 this . activeStreamingAssistantMessage ?? assistantMsg ,
429417 ) ;
430418 } finally {
431- logElapsed ( 'turn.total' , turnStartedAt ) ;
432419 const finalAssistantMsg = this . activeStreamingAssistantMessage ?? assistantMsg ;
433420 const turnMetadata = agentService . consumeTurnMetadata ( ) ;
434421 userMsg . userMessageId = turnMetadata . userMessageId ?? userMsg . userMessageId ;
0 commit comments