@@ -81,6 +81,72 @@ func loadTranscriptCmd(a agent.Agent) tea.Cmd {
8181 }
8282}
8383
84+ // normalizeCodexTool converts Codex tool names/params to Claude equivalents
85+ func normalizeCodexTool (name string , input map [string ]interface {}) (string , map [string ]interface {}) {
86+ normalized := make (map [string ]interface {})
87+ for k , v := range input {
88+ normalized [k ] = v
89+ }
90+
91+ switch name {
92+ case "shell_command" :
93+ return "Bash" , normalized
94+ case "read_file" :
95+ if path , ok := normalized ["path" ]; ok {
96+ delete (normalized , "path" )
97+ normalized ["file_path" ] = path
98+ }
99+ return "Read" , normalized
100+ case "write_file" :
101+ if path , ok := normalized ["path" ]; ok {
102+ delete (normalized , "path" )
103+ normalized ["file_path" ] = path
104+ }
105+ return "Write" , normalized
106+ case "edit_file" :
107+ if path , ok := normalized ["path" ]; ok {
108+ delete (normalized , "path" )
109+ normalized ["file_path" ] = path
110+ }
111+ return "Edit" , normalized
112+ default :
113+ return name , normalized
114+ }
115+ }
116+
117+ // normalizeGeminiTool converts Gemini tool names/params to Claude equivalents
118+ func normalizeGeminiTool (name string , input map [string ]interface {}) (string , map [string ]interface {}) {
119+ normalized := make (map [string ]interface {})
120+ for k , v := range input {
121+ normalized [k ] = v
122+ }
123+
124+ switch name {
125+ case "shell" :
126+ return "Bash" , normalized
127+ case "read_file" :
128+ if path , ok := normalized ["path" ]; ok {
129+ delete (normalized , "path" )
130+ normalized ["file_path" ] = path
131+ }
132+ return "Read" , normalized
133+ case "write_file" :
134+ if path , ok := normalized ["path" ]; ok {
135+ delete (normalized , "path" )
136+ normalized ["file_path" ] = path
137+ }
138+ return "Write" , normalized
139+ case "edit_file" :
140+ if path , ok := normalized ["path" ]; ok {
141+ delete (normalized , "path" )
142+ normalized ["file_path" ] = path
143+ }
144+ return "Edit" , normalized
145+ default :
146+ return name , normalized
147+ }
148+ }
149+
84150// convertCodexEntries converts Codex transcript entries to Claude entry format for TUI display.
85151func convertCodexEntries (codexEntries []codex.TranscriptEntry ) []claude.Entry {
86152 entries := make ([]claude.Entry , 0 , len (codexEntries ))
@@ -116,15 +182,17 @@ func convertCodexEntries(codexEntries []codex.TranscriptEntry) []claude.Entry {
116182 },
117183 }
118184 case "tool" :
119- // Codex tool call -> Claude assistant with tool_use (displayed as summary)
185+ // Normalize Codex tool name/params to Claude equivalents for rich formatting
186+ normalizedName , normalizedInput := normalizeCodexTool (ce .ToolName , ce .ToolInput )
120187 entry = claude.Entry {
121188 Type : "assistant" ,
122189 Message : claude.Message {
123190 Role : "assistant" ,
124191 Content : []interface {}{
125192 map [string ]interface {}{
126- "type" : "text" ,
127- "text" : ce .Content , // Already formatted as "[tool: name]"
193+ "type" : "tool_use" ,
194+ "name" : normalizedName ,
195+ "input" : normalizedInput ,
128196 },
129197 },
130198 },
@@ -186,15 +254,17 @@ func convertGeminiEntries(geminiEntries []gemini.TranscriptEntry) []claude.Entry
186254 },
187255 }
188256 case "tool" :
189- // Gemini tool call -> Claude assistant with tool info
257+ // Normalize Gemini tool name/params to Claude equivalents for rich formatting
258+ normalizedName , normalizedInput := normalizeGeminiTool (ge .ToolName , ge .ToolInput )
190259 entry = claude.Entry {
191260 Type : "assistant" ,
192261 Message : claude.Message {
193262 Role : "assistant" ,
194263 Content : []interface {}{
195264 map [string ]interface {}{
196- "type" : "text" ,
197- "text" : ge .Content , // Already formatted as "[tool: name]"
265+ "type" : "tool_use" ,
266+ "name" : normalizedName ,
267+ "input" : normalizedInput ,
198268 },
199269 },
200270 },
0 commit comments