Skip to content

Ask before create-bot and keep browser fallback#2

Merged
zzj3720 merged 11 commits intoHOOLC:mainfrom
suica:codex/readme-feishu-bot-prompt
Mar 10, 2026
Merged

Ask before create-bot and keep browser fallback#2
zzj3720 merged 11 commits intoHOOLC:mainfrom
suica:codex/readme-feishu-bot-prompt

Conversation

@suica
Copy link
Copy Markdown
Contributor

@suica suica commented Mar 9, 2026

Summary

  • update the copied bootstrap prompt so Codex first asks the user whether they want to create a new bot
  • if the answer is yes, Codex runs npx -y lark-op-cli@latest create-bot --name "Codex 机器人", streams output, and immediately surfaces any ASCII QR login prompt
  • if the answer is no, Codex continues with the original browser / Chrome CDP / agent-browser path for bot selection or creation

Why this matters

  • adds an explicit user decision point before switching to the scripted bot-creation path
  • keeps the original browser-based fallback intact instead of deleting it
  • limits the change to the prompt-facing docs only

Files changed

  • README.md
  • docs/codex-bootstrap-prompt.md
  • docs/codex-bootstrap-playbook.md

Validation

  • verified the PR still changes only 3 documentation files
  • checked that the copied prompt, the standalone prompt file, and the playbook describe the same branching behavior

@suica suica changed the title Refine bootstrap prompt for bot creation check Direct bootstrap flow to create a new Feishu bot Mar 9, 2026
@suica suica changed the title Direct bootstrap flow to create a new Feishu bot Simplify prompts to run create-bot only Mar 9, 2026
@suica suica changed the title Simplify prompts to run create-bot only Allow reusing an existing Feishu bot Mar 9, 2026
@suica suica changed the title Allow reusing an existing Feishu bot Refine bootstrap prompt for reusable bot flow Mar 9, 2026
@suica suica changed the title Refine bootstrap prompt for reusable bot flow Use one create-bot command to replace manual bot creation steps Mar 9, 2026
@suica suica changed the title Use one create-bot command to replace manual bot creation steps Use create-bot as the primary bot creation step Mar 9, 2026
@suica suica changed the title Use create-bot as the primary bot creation step Ask before create-bot and keep browser fallback Mar 9, 2026
@zzj3720
Copy link
Copy Markdown
Collaborator

zzj3720 commented Mar 10, 2026

@codex 来 review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 88930b6fc8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


```text
打开这个仓库后,严格按照 README.md、AGENTS.md、docs/codex-bootstrap-playbook.md、docs/feishu-console-automation.md 执行。优先走 Docker,不要把普通的控制台配置步骤推回给我。先运行 pnpm install、pnpm bootstrap:env、pnpm chrome:debug;如果我没登录飞书开放平台或 OpenAI/Codex,再停下来让我登录。登录完成后,Chrome CDP 自动配置飞书开发者平台,拿到 FEISHU_APP_ID 和 FEISHU_APP_SECRET 后写回 .env.real,然后用 Docker 启动并验证服务,最后告诉我怎么在飞书里测试。
打开这个仓库后,严格按照 README.md、AGENTS.md、docs/codex-bootstrap-playbook.md、docs/feishu-console-automation.md 执行。优先走 Docker,不要把普通的控制台配置步骤推回给我。先运行 pnpm install、pnpm bootstrap:env、pnpm chrome:debug。然后先明确问我一个问题:是否要创建新的机器人。如果我回答“要”,就异步执行 `npx -y lark-op-cli@latest create-bot --name "Codex 机器人"` 并持续读取输出;如果过程中出现扫码登录,请把 ASCII 二维码原样转发给我。如果我回答“不要”,再确认我是否已经登录飞书开放平台或 OpenAI/Codex;如果我没登录,再停下来让我登录。登录完成后,就继续走原来的浏览器和 agent-browser / Chrome CDP 方案,只选择已有机器人并完成后续配置,不要再创建新的机器人。拿到 FEISHU_APP_ID 和 FEISHU_APP_SECRET 后写回 .env.real,然后用 Docker 启动并验证服务,最后告诉我怎么在飞书里测试。
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep auth checkpoint in the create-bot branch

This prompt now gates the Feishu/OpenAI login check behind the 如果我回答“不要” branch, so users who answer “要” can be sent down create-bot without first handling missing auth state (for example, no local ~/.codex login). In that case the run can stall or fail later instead of stopping at the intended human checkpoint, which regresses the bootstrap reliability for fresh environments; keep the login check unconditional or duplicate it in the create-bot branch.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 88930b6fc8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

5. If the answer is no, connect to the Chrome CDP endpoint started by `pnpm chrome:debug`.
6. Open the Feishu Open Platform app list.
7. If the user is not logged in, stop and ask them to finish login in that browser window.
8. In the browser branch, continue with the original browser/CDP path and select an existing target bot in Feishu Open Platform. Do not create a new bot in this branch.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve app creation in browser fallback path

This step now forbids creating a bot in the browser fallback (Do not create a new bot in this branch), which regresses the prior flow where the browser path could still create an app when none existed. If a user answers “no” to the CLI create-bot branch (for example due to CLI/login constraints) and their tenant has no existing bot, the bootstrap process dead-ends and cannot reach the documented target state or produce FEISHU_APP_ID/FEISHU_APP_SECRET.

Useful? React with 👍 / 👎.

@zzj3720 zzj3720 merged commit 127d6a1 into HOOLC:main Mar 10, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants