Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc5ad0ac

Browse files
Fix: Remove invalid GetText() call on CallToolResult
Simplify workflow jobs pagination to directly handle jobs arrayinstead of trying to parse CallToolResult text content.
1 parent3a88695 commitc5ad0ac

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

‎pkg/github/actions.go‎

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -505,27 +505,23 @@ func ListWorkflowJobs(getClient GetClientFn, t translations.TranslationHelperFun
505505
}
506506
deferfunc() {_=resp.Body.Close() }()
507507

508-
// Note: This response includes optimization_tip, so we need to handle it differently
509-
// For now, we'll wrap jobs in pagination and include tip separately
510-
// Get the jobs array from the response
511-
paginatedJobs,err:=CreatePaginatedResponse(jobs,pagination.Page)
512-
iferr!=nil {
513-
returnnil,err
514-
}
515-
516-
// Parse the paginated response to add the tip
517-
varpaginatedDataPaginatedResponse
518-
iferr:=json.Unmarshal([]byte(paginatedJobs.GetText()),&paginatedData);err!=nil {
519-
returnpaginatedJobs,nil// Return as-is if parsing fails
508+
// Handle pagination and add optimization tip
509+
hasMore:=len(jobs.Jobs)>CursorPageSize
510+
jobsToReturn:=jobs.Jobs
511+
ifhasMore {
512+
jobsToReturn=jobs.Jobs[:CursorPageSize]
520513
}
521514

522515
response:=map[string]any{
523-
"items":paginatedData.Items,
524-
"moreData":paginatedData.MoreData,
525-
"cursor":paginatedData.Cursor,
516+
"jobs":jobsToReturn,
517+
"moreData":hasMore,
526518
"optimization_tip":"For debugging failed jobs, consider using get_job_logs with failed_only=true and run_id="+fmt.Sprintf("%d",runID)+" to get logs directly without needing to list jobs first",
527519
}
528520

521+
ifhasMore {
522+
response["cursor"]=EncodeCursor(pagination.Page+1)
523+
}
524+
529525
r,err:=json.Marshal(response)
530526
iferr!=nil {
531527
returnnil,fmt.Errorf("failed to marshal response: %w",err)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp