|
@@ -624,7 +624,7 @@ export const GithubRunCommand = cmd({
|
|
|
}
|
|
}
|
|
|
} catch (e: any) {
|
|
} catch (e: any) {
|
|
|
exitCode = 1
|
|
exitCode = 1
|
|
|
- console.error(e)
|
|
|
|
|
|
|
+ console.error(e instanceof Error ? e.message : String(e))
|
|
|
let msg = e
|
|
let msg = e
|
|
|
if (e instanceof $.ShellError) {
|
|
if (e instanceof $.ShellError) {
|
|
|
msg = e.stderr.toString()
|
|
msg = e.stderr.toString()
|
|
@@ -915,7 +915,7 @@ export const GithubRunCommand = cmd({
|
|
|
|
|
|
|
|
// result should always be assistant just satisfying type checker
|
|
// result should always be assistant just satisfying type checker
|
|
|
if (result.info.role === "assistant" && result.info.error) {
|
|
if (result.info.role === "assistant" && result.info.error) {
|
|
|
- console.error(result.info)
|
|
|
|
|
|
|
+ console.error("Agent error:", result.info.error)
|
|
|
throw new Error(
|
|
throw new Error(
|
|
|
`${result.info.error.name}: ${"message" in result.info.error ? result.info.error.message : ""}`,
|
|
`${result.info.error.name}: ${"message" in result.info.error ? result.info.error.message : ""}`,
|
|
|
)
|
|
)
|
|
@@ -944,7 +944,7 @@ export const GithubRunCommand = cmd({
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
if (summary.info.role === "assistant" && summary.info.error) {
|
|
if (summary.info.role === "assistant" && summary.info.error) {
|
|
|
- console.error(summary.info)
|
|
|
|
|
|
|
+ console.error("Summary agent error:", summary.info.error)
|
|
|
throw new Error(
|
|
throw new Error(
|
|
|
`${summary.info.error.name}: ${"message" in summary.info.error ? summary.info.error.message : ""}`,
|
|
`${summary.info.error.name}: ${"message" in summary.info.error ? summary.info.error.message : ""}`,
|
|
|
)
|
|
)
|
|
@@ -962,7 +962,7 @@ export const GithubRunCommand = cmd({
|
|
|
try {
|
|
try {
|
|
|
return await core.getIDToken("opencode-github-action")
|
|
return await core.getIDToken("opencode-github-action")
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
- console.error("Failed to get OIDC token:", error)
|
|
|
|
|
|
|
+ console.error("Failed to get OIDC token:", error instanceof Error ? error.message : error)
|
|
|
throw new Error(
|
|
throw new Error(
|
|
|
"Could not fetch an OIDC token. Make sure to add `id-token: write` to your workflow permissions.",
|
|
"Could not fetch an OIDC token. Make sure to add `id-token: write` to your workflow permissions.",
|
|
|
)
|
|
)
|