Skip to content

Create Bot on top of GitHub Copilot#128

Merged
0xba1a merged 12 commits intomainfrom
bala/integrate_ghcp
Apr 10, 2026
Merged

Create Bot on top of GitHub Copilot#128
0xba1a merged 12 commits intomainfrom
bala/integrate_ghcp

Conversation

@0xba1a
Copy link
Copy Markdown
Member

@0xba1a 0xba1a commented Apr 6, 2026

No description provided.

@0xba1a 0xba1a marked this pull request as draft April 6, 2026 11:00
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.08%. Comparing base (5e475e6) to head (bf8b15f).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #128      +/-   ##
==========================================
+ Coverage   96.43%   97.08%   +0.64%     
==========================================
  Files          28       30       +2     
  Lines        1264     1546     +282     
==========================================
+ Hits         1219     1501     +282     
  Misses         45       45              
Flag Coverage Δ
integration 51.87% <19.36%> (-6.99%) ⬇️
ollama_local 48.44% <19.36%> (-6.30%) ⬇️
slow-browser 40.10% <19.36%> (-4.76%) ⬇️
slow-other 58.86% <19.36%> (-8.23%) ⬇️
unit 88.22% <100.00%> (+2.62%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/microbots/__init__.py 100.00% <100.00%> (ø)
src/microbots/bot/CopilotBot.py 100.00% <100.00%> (ø)
src/microbots/bot/__init__.py 100.00% <100.00%> (ø)
src/microbots/environment/Environment.py 100.00% <100.00%> (ø)
...environment/local_docker/LocalDockerEnvironment.py 82.24% <100.00%> (+0.77%) ⬆️
src/microbots/utils/copilot_auth.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@0xba1a
Copy link
Copy Markdown
Member Author

0xba1a commented Apr 7, 2026

@copilot Add test cases for lines not covered by pytest. Check the Codecov Report for details.

@0xba1a
Copy link
Copy Markdown
Member Author

0xba1a commented Apr 7, 2026

@copilot Add test cases for lines not covered by pytest. Check the Codecov Report for details.

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 7, 2026

@copilot Add test cases for lines not covered by pytest. Check the Codecov Report for details.

Added test cases for all previously uncovered lines in commit 0ace218.

CopilotBot.py is now at 100% coverage — new tests cover:

  • __init__ with folder_to_mount string and auto-created environment
  • Non-ExternalTool installation (install_tool + verify_tool_installation)
  • _install_copilot_cli verification failure path
  • _start_copilot_cli_server (GitHub token injection, BYOK skip, start failure)
  • _wait_for_cli_ready (success, ConnectionRefusedError timeout, OSError retry)
  • run() with additional_mounts
  • _execute_session (provider config, system message, event callbacks for all event types, collected-text fallback, no-content fallback)
  • _on_pre_tool_use / _on_post_tool_use hooks (including long-result truncation)
  • _mount_additional (non-COPY raises, copy failure raises, copy success)

copilot_auth.py is also at 100% coverage via the new test/bot/test_copilot_auth.py — covering missing file, invalid JSON, missing/empty tokens, and successful token read.

@0xba1a
Copy link
Copy Markdown
Member Author

0xba1a commented Apr 9, 2026

@copilot Add test cases for lines not covered by pytest. Check the Codecov Report for details.

Added test cases for all previously uncovered lines in commit 0ace218.

CopilotBot.py is now at 100% coverage — new tests cover:

  • __init__ with folder_to_mount string and auto-created environment
  • Non-ExternalTool installation (install_tool + verify_tool_installation)
  • _install_copilot_cli verification failure path
  • _start_copilot_cli_server (GitHub token injection, BYOK skip, start failure)
  • _wait_for_cli_ready (success, ConnectionRefusedError timeout, OSError retry)
  • run() with additional_mounts
  • _execute_session (provider config, system message, event callbacks for all event types, collected-text fallback, no-content fallback)
  • _on_pre_tool_use / _on_post_tool_use hooks (including long-result truncation)
  • _mount_additional (non-COPY raises, copy failure raises, copy success)

copilot_auth.py is also at 100% coverage via the new test/bot/test_copilot_auth.py — covering missing file, invalid JSON, missing/empty tokens, and successful token read.

@copilot Test coverage is not 100%. 14 lines from 2 files are missed. Check the CodeCov report and add new or update existing test cases to cover those missing lines

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 9, 2026

@0xba1a Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub.

You can ask me to try again later by mentioning me in a new comment.

If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: d72ff8ab-b11b-48e0-b7a1-92e4dd8cac9b

Sorry for the inconvenience!

3 similar comments
Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 9, 2026

@0xba1a Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub.

You can ask me to try again later by mentioning me in a new comment.

If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: d72ff8ab-b11b-48e0-b7a1-92e4dd8cac9b

Sorry for the inconvenience!

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 9, 2026

@0xba1a Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub.

You can ask me to try again later by mentioning me in a new comment.

If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: d72ff8ab-b11b-48e0-b7a1-92e4dd8cac9b

Sorry for the inconvenience!

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 9, 2026

@0xba1a Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub.

You can ask me to try again later by mentioning me in a new comment.

If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: d72ff8ab-b11b-48e0-b7a1-92e4dd8cac9b

Sorry for the inconvenience!

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 9, 2026

@0xba1a Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub.

You can ask me to try again later by mentioning me in a new comment.

If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: d72ff8ab-b11b-48e0-b7a1-92e4dd8cac9b

Sorry for the inconvenience!

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 9, 2026

@copilot Add test cases for lines not covered by pytest. Check the Codecov Report for details.

Added test cases for all previously uncovered lines in commit 0ace218.
...

Added 44 new unit tests in commit b1b2cfd covering the uncovered new code in multi_agent_log_parser.py:

  • SetupInfo dataclass, Agent.error_message, TestCase.setup (new dataclass fields)
  • parse_log_entries() — legacy [LEVEL] format, multiple entries, continuation lines
  • _extract_setup_info() — all extraction patterns (container, working dir, volumes, tools, files; stops at TASK STARTED)
  • extract_task_from_microbot_sub() — all --task flag patterns and fallback
  • build_test_cases() — TASK STARTED/COMPLETED, sub-agent error_message, parse-error blocking
  • truncate_text(), generate_setup_md(), _agent_status_str() (new pure functions)

The 8 lines from LocalDockerEnvironment.get_ipv4_address were already addressed by TestGetIpv4Address in commit cf039f5. All 577 unit tests now pass.

@0xba1a 0xba1a marked this pull request as ready for review April 10, 2026 05:48
@@ -0,0 +1,716 @@
"""
Copy link
Copy Markdown
Collaborator

@shivashanmugam shivashanmugam Apr 10, 2026

Choose a reason for hiding this comment

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

CopilotBot does not inheriting from Microbot
which makes sense. But do we need have Abstract BaseClass for CopilotBot and Microbot something called BaseBot.

@0xba1a 0xba1a merged commit 85f1a1a into main Apr 10, 2026
7 checks 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.

4 participants