Skip to content

Fix/edit tool calls#103

Open
i1bro wants to merge 12 commits intomainfrom
fix/edit-tool-calls
Open

Fix/edit tool calls#103
i1bro wants to merge 12 commits intomainfrom
fix/edit-tool-calls

Conversation

@i1bro
Copy link
Copy Markdown
Collaborator

@i1bro i1bro commented Apr 20, 2026

Summary

  • capture file-change context from app-server events for later approval and tool-call updates
  • use edited file paths as edit tool-call titles instead of the generic "Editing files"
  • attach file locations and diff data to edit tool calls, with a turn-diff fallback when needed
  • serialize session updates so the initial tool call is emitted before its completion update

Why

This makes edit tool calls understandable in the UI and avoids races where a completion update can arrive before the corresponding tool call exists.

Testing

  • npm test

Comment thread src/CodexAppServerClient.ts Outdated
Comment thread src/CodexAppServerClient.ts Outdated
Comment thread src/CodexAcpClient.ts Outdated
Comment thread src/CodexAppServerClient.ts Outdated
}
}

async flushServerNotifications(sessionId: string): Promise<void> {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why do we need a queue and then why we need to flush it instead of handling events?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because sendPrompt() must not return until all earlier events have been handled.

Comment thread src/CodexApprovalHandler.ts Outdated
Comment thread src/CodexAcpServer.ts Outdated
Comment thread src/CodexEventHandler.ts Outdated
Comment thread src/CodexAcpClient.ts Outdated
Comment thread src/CodexAcpClient.ts Outdated
Comment thread src/CodexToolCallMapper.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants