@@ -810,16 +810,22 @@ const skillsNamed = (text: string, known: ReadonlySet<string>) => [
810810/**
811811 * A message's pasted images as prompt files, which OpenCode reads from T3's
812812 * attachment directory and gives the model as images. The prompt text still
813- * names where each one is saved, as with 1.x.
813+ * names where each one is saved, as with 1.x. A server T3 did not start may
814+ * not see that directory, so it gets the path text only.
814815 */
815816export const promptImageFiles = (
816817 attachments : ReadonlyArray < ChatAttachment > ,
817818 attachmentsDir : string ,
819+ external : boolean ,
818820) =>
819- attachments . filter ( isProviderNativeImageAttachment ) . flatMap ( ( attachment ) => {
820- const path = resolveAttachmentPath ( { attachmentsDir, attachment } ) ;
821- return path === null ? [ ] : [ { uri : NodeURL . pathToFileURL ( path ) . href , name : attachment . name } ] ;
822- } ) ;
821+ external
822+ ? [ ]
823+ : attachments . filter ( isProviderNativeImageAttachment ) . flatMap ( ( attachment ) => {
824+ const path = resolveAttachmentPath ( { attachmentsDir, attachment } ) ;
825+ return path === null
826+ ? [ ]
827+ : [ { uri : NodeURL . pathToFileURL ( path ) . href , name : attachment . name } ] ;
828+ } ) ;
823829
824830/**
825831 * The turn's own tokens: steps add up, and the last step's input is the live
@@ -3561,7 +3567,11 @@ export const make = Effect.fn("OpenCode2Adapter.make")(function* (instanceId: Pr
35613567 ) ,
35623568 )
35633569 : [ ] ;
3564- const files = promptImageFiles ( turnInput . message . attachments , serverConfig . attachmentsDir ) ;
3570+ const files = promptImageFiles (
3571+ turnInput . message . attachments ,
3572+ serverConfig . attachmentsDir ,
3573+ connection . external ,
3574+ ) ;
35653575 if ( ! sending ( ) ) return ;
35663576 return yield * client . session
35673577 . prompt ( {
@@ -3907,6 +3917,7 @@ export const make = Effect.fn("OpenCode2Adapter.make")(function* (instanceId: Pr
39073917 const files = promptImageFiles (
39083918 steerInput . message . attachments ,
39093919 serverConfig . attachmentsDir ,
3920+ connection . external ,
39103921 ) ;
39113922 yield * client . session
39123923 . prompt ( {
0 commit comments