Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

chat().createAndPoll()执行完成之后程序不会结束

Open
#121 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
32/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
api

Research direction

Start by running the supplied Java main example with chat().createAndPoll(req, 3000L), then inspect the lifecycle around createAndPoll and coze.shutdownExecutor(). Confirm whether the process remains alive after the response is printed and define done as the program exiting cleanly after polling completes.

Written by the indexing model from the issue text.

Description

chat().createAndPoll()执行完成之后程序不会结束。程序一直挂在那,貌似有什么线程卡住了。
`
public static void main(String[] args) throws Exception {
String cozeAPIToken = "cozeAPIToken";
String cozeAPIBase = Consts.COZE_CN_BASE_URL;
CozeAPI coze = new CozeAPI.Builder().auth(new TokenAuth(cozeAPIToken)).baseURL(cozeAPIBase).build();

  CreateChatReq req =
          CreateChatReq.builder()
                  .botID("botID")
                  .userID("123")
                  .messages(Collections.singletonList(Message.buildUserQuestionText("翻译\"你好,世界!\"")))
                  .build();
  ChatPoll chat2 = coze.chat().createAndPoll(req, 3000L);
  System.out.println(chat2.getMessages().get(0).getContent());
  coze.shutdownExecutor();

}
`

Image

Dominant language
Java
Stars
214
Forks
97
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from coze-dev/coze-java

All issues in coze-dev/coze-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.