iflow-cli-action icon indicating copy to clipboard operation
iflow-cli-action copied to clipboard

使用官方给的示例,出现多个报错,脚本执行失败

Open songjingwei opened this issue 1 year ago • 5 comments

name: "🏷️ iFLOW CLI Automated Issue Triage"

on:
  issues:
    types:
      - "opened"
      - "reopened"
  issue_comment:
    types:
      - "created"
  workflow_dispatch:
    inputs:
      issue_number:
        description: "issue number to triage"
        required: true
        type: "number"

concurrency:
  group: "${{ github.workflow }}-${{ github.event.issue.number }}"
  cancel-in-progress: true

defaults:
  run:
    shell: "bash"

permissions:
  contents: "read"
  issues: "write"
  statuses: "write"

jobs:
  triage-issue:
    if: |-
      github.event_name == 'issues' ||
      github.event_name == 'workflow_dispatch' ||
      (
        github.event_name == 'issue_comment' &&
        contains(github.event.comment.body, '@iflow-cli /triage') &&
        contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association)
      )
    runs-on: "ubuntu-latest"
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: "Run iFlow CLI Issue Triage"
        uses: iflow-ai/[email protected]
        id: "iflow_cli_issue_triage"
        env:
          GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
          ISSUE_TITLE: "${{ github.event.issue.title }}"
          ISSUE_BODY: "${{ github.event.issue.body }}"
          ISSUE_NUMBER: "${{ github.event.issue.number }}"
          REPOSITORY: "${{ github.repository }}"
        with:
          api_key: ${{ secrets.IFLOW_API_KEY }}
          timeout: "3600"
          debug: "true"
          prompt: |
            ## Role

            You are an issue triage assistant. Analyze the current GitHub issue
            and apply the most appropriate existing labels. Use the available
            tools to gather information; do not ask for information to be
            provided.

            ## Steps

            1. Run: `gh label list` to get all available labels.
            2. Review the issue title and body provided in the environment
               variables: "${ISSUE_TITLE}" and "${ISSUE_BODY}".
            3. Classify issues by their kind (bug, enhancement, documentation,
               cleanup, etc) and their priority (p0, p1, p2, p3). Set the
               labels according to the format `kind/*` and `priority/*` patterns.
            4. Apply the selected labels to this issue using:
               `gh issue edit "${ISSUE_NUMBER}" --add-label "label1,label2"`
            5. If the "status/needs-triage" label is present, remove it using:
               `gh issue edit "${ISSUE_NUMBER}" --remove-label "status/needs-triage"`

            ## Guidelines

            - Only use labels that already exist in the repository
            - Do not add comments or modify the issue content
            - Triage only the current issue
            - Assign all applicable labels based on the issue content
            - Reference all shell variables as "${VAR}" (with quotes and braces)

      - name: "Post Issue Triage Failure Comment"
        if: |-
          ${{ failure() && steps.iflow_cli_issue_triage.outcome == 'failure' }}
        uses: "actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea"
        with:
          github-token: "${{ secrets.GITHUB_TOKEN }}"
          script: |-
            github.rest.issues.createComment({
              owner: '${{ github.repository }}'.split('/')[0],
              repo: '${{ github.repository }}'.split('/')[1],
              issue_number: '${{ github.event.issue.number }}',
              body: 'There is a problem with the iFlow CLI issue triaging. Please check the [action logs](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) for details.'
            })

上面是我从官网复制的 actions yml,在 github 运行时会报错: 1.

ACP] starting server with: { "workspace": "/github/workspace", "port": "8090", "verbose": true, "disableTools": false } 🚀 iFlow ACP Server running at http://localhost:8090 🚨 Unhandled Promise Rejection detected: { Error: n: FI [Error]: Author identity unknown

*** Please tell me who you are.

Run

git config --global user.email "[email protected]"
git config --global user.name "Your Name"

to set your account's default identity. Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'root@cd0423833f8b.(none)')

  at Object.action (file:///usr/lib/node_modules/@iflow-ai/iflow-cli/bundle/iflow.js:3785:16234)
  at u4s.exec (file:///usr/lib/node_modules/@iflow-ai/iflow-cli/bundle/iflow.js:3786:8625)
  at file:///usr/lib/node_modules/@iflow-ai/iflow-cli/bundle/iflow.js:3785:28896
  at new Promise (<anonymous>)
  at GGt.handleTaskData (file:///usr/lib/node_modules/@iflow-ai/iflow-cli/bundle/iflow.js:3785:28785)
  at GGt.attemptRemoteTask (file:///usr/lib/node_modules/@iflow-ai/iflow-cli/bundle/iflow.js:3785:28438)
  at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
  at async GGt.attemptTask (file:///usr/lib/node_modules/@iflow-ai/iflow-cli/bundle/iflow.js:3785:27919) {
task: { commands: [Array], format: 'utf-8', parser: [Function: ivs] }

}, promise: '[object Promise]' }

❌ Error sending message: Protocol error: Prompt failed: Object {"code": Number(-32603), "data": Object {"details": String("generate data error: The specified model is not supported")}, "message": String("Internal error")} 2025-12-01T14:17:56.863842Z DEBUG iflow_cli_sdk_rust::websocket_transport: Received message: {"jsonrpc":"2.0","id":4,"error":{"code":-32603,"message":"Internal error","data":{"details":"generate data error: The specified model is not supported"}}} ACP client error: WebSocket client error: Protocol error: Prompt failed: Object {"code": Number(-32603), "data": Object {"details": String("generate data error: The specified model is not supported")}, "message": String("Internal error")} 2025-12-01T14:17:56.863880Z ERROR iflow_cli_sdk_rust::client: Failed to send prompt: Protocol error: Prompt failed: Object {"code": Number(-32603), "data": Object {"details": String("generate data error: The specified model is not supported")}, "message": String("Internal error")}

songjingwei avatar Dec 01 '25 14:12 songjingwei

There is a problem with the iFlow CLI issue triaging. Please check the action logs for details.

github-actions[bot] avatar Dec 01 '25 14:12 github-actions[bot]

原因是默认模型不被支持了,切换模型就可以了 model: "qwen3-coder-plus"

66six11 avatar Dec 01 '25 15:12 66six11

第一个git配置信息需要加一个iflow运行后指令来配置 代码片段如下

  api_key: ${{ secrets.IFLOW_API_KEY }}
  model: "qwen3-coder-plus"
  timeout: "3600"
  debug: "true"
  precmd: |
    git config --global user.email "github-actions[bot]@users.noreply.github.com"
    git config --global user.name "github-actions[bot]"
  prompt: |

66six11 avatar Dec 01 '25 16:12 66six11

按照 @66six11 的建议,切换模型就可以了。

另外官网示例中使用 github mcp 也会报错,建议使用下面这种方式使用 github mcp server。

{
    "mcpServers": {
        "github": {
            "httpUrl": "https://api.githubcopilot.com/mcp/",
            "headers": {
                "Authorization": "Bearer $GITHUB_MCP_PAT"
            }
        }
    }
}

songjingwei avatar Dec 02 '25 11:12 songjingwei

我刷新下,感谢反馈~

yeshan333 avatar Dec 08 '25 02:12 yeshan333