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

feat: Include Kubernetes Events for failed tasks in LLM context #2304

Open
Labels
@chmouel

Description

@chmouel

Description

Include Kubernetes Events associated with failed TaskRuns in the LLM context to provide richer diagnostic information for AI-powered analysis.

Context

This was suggested in PR#2292 review comment:#2292 (comment)

Currently, the LLM context for failed tasks (pkg/llm/context/assembler.go:232-248) includes:

  • Task name, reason, message
  • Log snippet
  • Display name and completion time

But doesnot include Kubernetes Events, which can provide valuable diagnostic information such as:

  • Pod scheduling issues
  • Container failures
  • Resource constraints (memory/CPU limits)
  • Image pull errors
  • Volume mount issues
  • Other system-level failures

Proposed Changes

  1. Extend TaskInfos struct (pkg/apis/pipelinesascode/v1alpha1/types.go:72):

    typeTaskInfosstruct {Namestring`json:"name"`Messagestring`json:"message,omitempty"`LogSnippetstring`json:"log_snippet,omitempty"`Reasonstring`json:"reason,omitempty"`DisplayNamestring`json:"display_name,omitempty"`CompletionTime*metav1.Time`json:"completion_time,omitempty"`Events         []Event`json:"events,omitempty"`// NEW}
  2. Update CollectFailedTasksLogSnippet (pkg/kubeinteraction/status/task_status.go:76):

    • For each failed TaskRun, callkinteract.GetEvents(ctx, namespace, "TaskRun", taskRunName)
    • Add events to the TaskInfos struct
  3. Update buildErrorContent (pkg/llm/context/assembler.go:232):

    • Include events in the failedTask map when building context

Benefits

  • Better root cause analysis for failures related to infrastructure/platform issues
  • LLM can distinguish between application failures vs platform failures
  • More comprehensive context for suggesting fixes

Implementation Notes

The infrastructure already exists:

  • GetEvents method available inpkg/kubeinteraction/events.go:11
  • Already used for Repository and PipelineRun objects inpkg/cmd/tknpac/describe/describe.go:190,207

Priority

This is a future enhancement and not blocking for the initial LLM analysis feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp