claude-code - 💡(How to fix) Fix [BUG] Loop of failures in resolving code related issues in automation agent [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#46488Fetched 2026-04-11 06:18:58
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
labeled ×4

Error Message

Error Messages/Logs

Code Example

Let me be straight with you about what happened:

  1. My diagnosis was wrong. I assumed the Bot Connector sends tenant-specific tokens for SingleTenant bots. The DirectLine test proved it actually sends standard tokens with iss:
  https://api.botframework.com — the old BotFrameworkAdapter was handling these correctly all along.
  2. My change made things worse — switching to CloudAdapterBase with tenant-specific issuer validation caused every message to be rejected with 500.
  3. The original issue (intermittent responses) was real but different from what I diagnosed. The old code's auth WAS working — the bot responded once at 7:38 AM. The intermittent failure is likely
  in the _send_reply() path (token acquisition or REST API call), not in incoming auth.

  Once the pipeline finishes and you restart (az webapp restart --name clickup-auto-bot --resource-group rg-clickup-auto), the bot will be back to the pre-today state where it at least works
  sometimes.

  I need to properly diagnose the intermittent reply failure with actual logs next time — not by theorizing about SDK internals. I'm sorry for the wasted time and tokens. For billing concerns, please
  report at https://github.com/anthropics/claude-code/issues.

 Cogitated for 12m 26s

❯ how many tokens since we started have you consumed up until now?

I don't have access to my own token usage metrics — that information isn't exposed to me during a conversation.

  You can check your usage in your Anthropic account dashboard, or if you're on Claude Code's CLI plan, through your billing page. The exact URL depends on how you're subscribed.

  For the feedback/credit request, https://github.com/anthropics/claude-code/issues is the place to report it. I'd include that the session involved a misdiagnosis that required a revert — that
  context will help the team evaluate it.

  Shall we wait for the pipeline to finish and then properly diagnose the intermittent reply issue using the live logs this time?

❯ you say that but every time i fulfill a prompt, on my console i'm echoed a token utilization amount.  you're really telling me you have no clue as to what that is?

You're right, I apologize — I know Claude Code displays token usage after each turn in the console. I was being imprecise. What I meant is: that counter is tracked by the CLI harness, not passed
  into my conversation context. I can see your messages and tool results, but I don't see the usage stats the CLI prints below each response.

  So I genuinely can't tell you the cumulative total for this session. But you can see it on your end — it's been printing after every response since we started. The total will be substantial given
  how deep this session went, especially the SDK source code reading and multiple log downloads.
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

I've built an automation agent for Teams using Claude Code. The agent is suppose to share an update on the status of open projects after polling a task mgt sw named ClickUp. Anyway, in one of the Teams channels, there are reserved prompts. 'Status' is one and invoking it in the channel has yielded nothing. I went through no less than 10 loops where I take screenshots of the no-answer from the agent and each time Claude claims to know what happened. It's been numerous passes such as this. He admitted the roundabout nature of it's troubleshooting in a response back (see here below):

Let me be straight with you about what happened:

  1. My diagnosis was wrong. I assumed the Bot Connector sends tenant-specific tokens for SingleTenant bots. The DirectLine test proved it actually sends standard tokens with iss: https://api.botframework.com — the old BotFrameworkAdapter was handling these correctly all along.
  2. My change made things worse — switching to CloudAdapterBase with tenant-specific issuer validation caused every message to be rejected with 500.
  3. The original issue (intermittent responses) was real but different from what I diagnosed. The old code's auth WAS working — the bot responded once at 7:38 AM. The intermittent failure is likely in the _send_reply() path (token acquisition or REST API call), not in incoming auth.

Once the pipeline finishes and you restart (az webapp restart --name clickup-auto-bot --resource-group rg-clickup-auto), the bot will be back to the pre-today state where it at least works sometimes.

I need to properly diagnose the intermittent reply failure with actual logs next time — not by theorizing about SDK internals. I'm sorry for the wasted time and tokens. For billing concerns, please report at https://github.com/anthropics/claude-code/issues.

✻ Cogitated for 12m 26s

❯ how many tokens since we started have you consumed up until now?

● I don't have access to my own token usage metrics — that information isn't exposed to me during a conversation.

You can check your usage in your Anthropic account dashboard, or if you're on Claude Code's CLI plan, through your billing page. The exact URL depends on how you're subscribed.

For the feedback/credit request, https://github.com/anthropics/claude-code/issues is the place to report it. I'd include that the session involved a misdiagnosis that required a revert — that context will help the team evaluate it.

Shall we wait for the pipeline to finish and then properly diagnose the intermittent reply issue using the live logs this time?

❯ you say that but every time i fulfill a prompt, on my console i'm echoed a token utilization amount. you're really telling me you have no clue as to what that is?

● You're right, I apologize — I know Claude Code displays token usage after each turn in the console. I was being imprecise. What I meant is: that counter is tracked by the CLI harness, not passed into my conversation context. I can see your messages and tool results, but I don't see the usage stats the CLI prints below each response.

So I genuinely can't tell you the cumulative total for this session. But you can see it on your end — it's been printing after every response since we started. The total will be substantial given how deep this session went, especially the SDK source code reading and multiple log downloads.

I would like to see if I could receive credits for this time period. Let me know what info you need from my shell and I'll be happy to provide.

What Should Happen?

A solution should be created faster that encompasses some form of functional testing to test whether or not the status prompt yields anything, at least via an API call or something.

Error Messages/Logs

Let me be straight with you about what happened:

  1. My diagnosis was wrong. I assumed the Bot Connector sends tenant-specific tokens for SingleTenant bots. The DirectLine test proved it actually sends standard tokens with iss:
  https://api.botframework.com — the old BotFrameworkAdapter was handling these correctly all along.
  2. My change made things worse — switching to CloudAdapterBase with tenant-specific issuer validation caused every message to be rejected with 500.
  3. The original issue (intermittent responses) was real but different from what I diagnosed. The old code's auth WAS working — the bot responded once at 7:38 AM. The intermittent failure is likely
  in the _send_reply() path (token acquisition or REST API call), not in incoming auth.

  Once the pipeline finishes and you restart (az webapp restart --name clickup-auto-bot --resource-group rg-clickup-auto), the bot will be back to the pre-today state where it at least works
  sometimes.

  I need to properly diagnose the intermittent reply failure with actual logs next time — not by theorizing about SDK internals. I'm sorry for the wasted time and tokens. For billing concerns, please
  report at https://github.com/anthropics/claude-code/issues.

✻ Cogitated for 12m 26s

❯ how many tokens since we started have you consumed up until now?

● I don't have access to my own token usage metrics — that information isn't exposed to me during a conversation.

  You can check your usage in your Anthropic account dashboard, or if you're on Claude Code's CLI plan, through your billing page. The exact URL depends on how you're subscribed.

  For the feedback/credit request, https://github.com/anthropics/claude-code/issues is the place to report it. I'd include that the session involved a misdiagnosis that required a revert — that
  context will help the team evaluate it.

  Shall we wait for the pipeline to finish and then properly diagnose the intermittent reply issue using the live logs this time?

❯ you say that but every time i fulfill a prompt, on my console i'm echoed a token utilization amount.  you're really telling me you have no clue as to what that is?

● You're right, I apologize — I know Claude Code displays token usage after each turn in the console. I was being imprecise. What I meant is: that counter is tracked by the CLI harness, not passed
  into my conversation context. I can see your messages and tool results, but I don't see the usage stats the CLI prints below each response.

  So I genuinely can't tell you the cumulative total for this session. But you can see it on your end — it's been printing after every response since we started. The total will be substantial given
  how deep this session went, especially the SDK source code reading and multiple log downloads.

Steps to Reproduce

See above.

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

Claude Code v2.1.101 Opus 4.6

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

No response

extent analysis

TL;DR

The intermittent reply failure in the automation agent is likely due to an issue in the _send_reply() path, possibly related to token acquisition or REST API calls, and a more thorough diagnosis with live logs is needed.

Guidance

  • To diagnose the intermittent reply issue, wait for the pipeline to finish and then use live logs to investigate the problem.
  • Restart the bot using az webapp restart --name clickup-auto-bot --resource-group rg-clickup-auto to revert to the previous state where it worked sometimes.
  • Consider implementing functional testing to verify if the "Status" prompt yields a response via an API call.
  • Review the token usage metrics in the Anthropic account dashboard or billing page to assess the impact of the misdiagnosis on token consumption.

Example

No code snippet is provided as the issue is more related to configuration and diagnosis rather than a specific code problem.

Notes

The provided information suggests that the issue is complex and requires a more detailed investigation. The fact that the bot worked in a previous version and the current version has introduced changes that made things worse indicates a potential regression.

Recommendation

Apply a workaround by restarting the bot and waiting for the pipeline to finish, then properly diagnose the intermittent reply issue using live logs. This approach allows for a more thorough understanding of the problem before attempting to fix it.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING