Skip to content

Conversation

@konard
Copy link
Contributor

@konard konard commented Jan 1, 2026

Summary

Fixes an issue where bash commands were displayed in GitHub comments instead of only in the logs, and implements dual resume command support.

Problem

When usage limit was reached, the GitHub comment showed bash commands like:

(cd "/tmp/gh-issue-solver-..." && claude --resume session-id)

This was not user-friendly because users interact via Telegram bot, not CLI commands directly.

Solution

  1. GitHub comments only mention the --auto-continue-on-limit-reset option, which works for all ways to call the solver (Telegram bot, CLI, etc.).

  2. Logs now show both interactive and autonomous resume commands:

    • Interactive mode: Opens Claude Code for user interaction
      (cd "/tmp/gh-issue-solver-..." && claude --resume session-id)
    • Autonomous mode: Continues work without user interaction
      (cd "/tmp/gh-issue-solver-..." && claude --resume session-id --output-format stream-json --dangerously-skip-permissions -p "Continue.")

Changes

  • Added buildClaudeAutonomousResumeCommand in src/claude.command-builder.lib.mjs
  • Updated src/solve.mjs to show both resume commands in logs
  • Updated src/solve.results.lib.mjs showSessionSummary to show both commands
  • Updated src/claude.lib.mjs showResumeCommand and formatUsageLimitMessage calls
  • Updated src/usage-limit.lib.mjs formatUsageLimitMessage for dual command support
  • Updated tests for both command formats

Test Plan

  • ESLint checks pass
  • Prettier formatting checks pass
  • test-build-resume-command.mjs tests pass (28 tests)
  • test-usage-limit.mjs tests pass (25 tests)
  • CI checks pass

References

Fixes #942

🤖 Generated with Claude Code

Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: #942
@konard konard self-assigned this Jan 1, 2026
When usage limit is reached or Claude command fails, the log now shows
the Claude CLI resume command instead of the solve.mjs command:

Before:
  /home/hive/.nvm/versions/node/v20.19.6/bin/node /home/hive/.bun/bin/solve https://... --resume session-id

After:
  (cd "/tmp/gh-issue-solver-..." && claude --resume session-id)

This allows users to resume directly using Claude CLI in interactive mode
after the limit resets. The command is also captured in the logs that get
uploaded to PR comments, making it easy for users to find and use.

Changes:
- Modified formatUsageLimitMessage call to use buildClaudeResumeCommand
- Modified failure message to use buildClaudeResumeCommand
- Both now generate the (cd ... && claude --resume ...) pattern

Fixes #942

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@konard konard changed the title [WIP] On limit reached, we should help user to make it possible to resume himself manually fix: use Claude CLI resume command in logs instead of solve.mjs command Jan 1, 2026
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@konard konard force-pushed the issue-942-d0a1851786bc branch from c55a814 to 249646e Compare January 1, 2026 22:02
@konard konard marked this pull request as ready for review January 1, 2026 22:08
@konard
Copy link
Contributor Author

konard commented Jan 1, 2026

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $12.178335 USD
  • Calculated by Anthropic: $7.830241 USD
  • Difference: $-4.348094 (-35.70%)
    📎 Log file uploaded as GitHub Gist (1107KB)
    🔗 View complete solution draft log

Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Contributor Author

konard commented Jan 1, 2026

No commands should be in GitHub comment. We may only suggest user to use and option because our users do not call CLI commands, they are calling /solve command via telegram bot. So option will work, but we should not also mention /solve command, because we should just inform about the option, so the test will be valid for all ways to call.

As for claude command copiable command, we should make sure it is in logs, not in the comment itself. I mean logs are either the link, or in collapsed block, not immediately visible by the user.

@konard konard marked this pull request as draft January 2, 2026 21:56
@konard
Copy link
Contributor Author

konard commented Jan 2, 2026

🤖 AI Work Session Started

Starting automated work session at 2026-01-02T21:56:53.719Z

The PR has been converted to draft mode while work is in progress.

This comment marks the beginning of an AI work session. Please wait working session to finish, and provide your feedback.

Per reviewer feedback, bash commands should not appear in GitHub comments
because users interact via Telegram bot, not CLI. Now:
- GitHub comments only mention the --auto-continue-on-limit-reset option
- Resume commands are kept in logs (collapsed block or gist link)
- Session ID is still shown for reference

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@konard konard marked this pull request as ready for review January 2, 2026 22:07
@konard
Copy link
Contributor Author

konard commented Jan 2, 2026

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $3.146064 USD
  • Calculated by Anthropic: $2.016488 USD
  • Difference: $-1.129575 (-35.90%)
    📎 Log file uploaded as GitHub Gist (506KB)
    🔗 View complete solution draft log

Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Contributor Author

konard commented Jan 11, 2026

I think in all places of this feature we should support interactive --resume command and also fully autonomous --resume command with all prompt and system message and so on preparated as single line command that user can just easily copy.

So both commands (short interactive and large autonomous) should be shown, both just execute claude command but in different modes.

@konard konard marked this pull request as draft January 11, 2026 01:48
@konard
Copy link
Contributor Author

konard commented Jan 11, 2026

🤖 AI Work Session Started

Starting automated work session at 2026-01-11T01:48:21.188Z

The PR has been converted to draft mode while work is in progress.

This comment marks the beginning of an AI work session. Please wait working session to finish, and provide your feedback.

konard and others added 2 commits January 11, 2026 02:49
Resolved conflict in src/solve.mjs:
- Kept the --auto-continue-on-limit-reset option suggestion (no CLI commands in GitHub comments)
- Kept the formattedResetTime with relative time formatting from main

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implements user feedback from PR #1053:
- Added buildClaudeAutonomousResumeCommand for fully autonomous resumption
- Both commands are now shown in all places where resume commands appear:
  - Interactive mode: Opens Claude Code for user interaction
  - Autonomous mode: Continues work without user interaction

Changes:
- src/claude.command-builder.lib.mjs: Added buildClaudeAutonomousResumeCommand
- src/solve.mjs: Updated to show both resume command types
- src/solve.results.lib.mjs: Updated showSessionSummary to show both commands
- src/claude.lib.mjs: Updated showResumeCommand and formatUsageLimitMessage calls
- src/usage-limit.lib.mjs: Updated formatUsageLimitMessage to support dual commands
- tests/test-build-resume-command.mjs: Added tests for autonomous resume command
- tests/test-usage-limit.mjs: Added tests for dual command format

Related: #942

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@konard konard changed the title fix: use Claude CLI resume command in logs instead of solve.mjs command feat: add both interactive and autonomous resume commands in logs Jan 11, 2026
@konard konard marked this pull request as ready for review January 11, 2026 02:00
@konard
Copy link
Contributor Author

konard commented Jan 11, 2026

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $7.541395 USD
  • Calculated by Anthropic: $4.526173 USD
  • Difference: $-3.015221 (-39.98%)
    📎 Log file uploaded as GitHub Gist (1112KB)
    🔗 View complete solution draft log

Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Contributor Author

konard commented Jan 19, 2026

We need to resolve conflicts and also should apply experience from #1139 here.

Ensure all changes are correct, consistent and fully meet the requirements.

@konard konard marked this pull request as draft January 19, 2026 22:14
@konard
Copy link
Contributor Author

konard commented Jan 19, 2026

🤖 AI Work Session Started

Starting automated work session at 2026-01-19T22:14:33.991Z

The PR has been converted to draft mode while work is in progress.

This comment marks the beginning of an AI work session. Please wait working session to finish, and provide your feedback.

konard and others added 2 commits January 19, 2026 23:16
Per PR requirements, GitHub comments should only mention the
--auto-continue-on-limit-reset option and session ID, but not
include actual resume commands. Resume commands are still shown
in the console logs and attached gist/log files.

This ensures:
- GitHub comments remain clean and focused on actionable options
- Advanced users can find resume commands in logs/gists
- The session ID is always available for manual lookups

Related to issue #942.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@konard konard marked this pull request as ready for review January 19, 2026 22:25
@konard
Copy link
Contributor Author

konard commented Jan 19, 2026

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $7.138386 USD
  • Calculated by Anthropic: $3.839358 USD
  • Difference: $-3.299028 (-46.22%)
    📎 Log file uploaded as Gist (862KB)
    🔗 View complete solution draft log

Now working session is ended, feel free to review and add any feedback on the solution draft.

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.

On limit reached, we should help user to make it possible to resume himself manually

2 participants