fix(opencode): read V2 session exports directly from authenticated API
This commit is contained in:
@@ -85,7 +85,7 @@ func (c *Connection) Messages(ctx context.Context, id string) ([]byte, error) {
|
||||
if executable == "" {
|
||||
executable = Executable()
|
||||
}
|
||||
res, exportErr := exportNative(ctx, executable, c.Directory, c.Backend, id, MaxResponse)
|
||||
res, exportErr := exportNative(ctx, executable, c.Directory, c.Backend, id, MaxResponse, c)
|
||||
if exportErr != nil {
|
||||
if ctx.Err() != nil {
|
||||
return data, ctx.Err()
|
||||
@@ -102,5 +102,8 @@ func (c *Connection) Messages(ctx context.Context, id string) ([]byte, error) {
|
||||
return data, fmt.Errorf("%w; native export returned invalid or mismatched session evidence", err)
|
||||
}
|
||||
c.MessageReadbackDiagnostic = "Native HTTP message readback rejected stored OutputFormat (HTTP 400); read-only CLI export recovered the original messages without modifying the session."
|
||||
if c.Backend == "v2" {
|
||||
c.MessageReadbackDiagnostic = "Native HTTP message readback rejected stored OutputFormat (HTTP 400); read-only HTTP export recovered the original messages without modifying the session."
|
||||
}
|
||||
return messages, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user