16 Commits

Author SHA1 Message Date
Xubin Ren
c018c3fb6a chore(release): bundle webui into wheel and prep 0.2.0 2026-05-16 13:38:11 +00:00
Xubin Ren
897eedaaa7 chore(ci): update Python version in CI workflow to focus on supported runtimes 3.13 and 3.14 2026-05-16 04:15:58 +00:00
Xubin Ren
4f1faea90c ci: optimize Test Suite workflow (safe subset)
Re-applies the safe portion of c01f8599 after the revert in 2e8e674e.
Drops the uv cache which broke last time because uv.lock is gitignored
in this repo, and keeps lint as a step inside the test job (matching
the pre-c01f8599 layout).

What's added (all metadata-only, no external dependencies):
- concurrency: cancel superseded runs on the same ref
- permissions: tighten GITHUB_TOKEN to contents: read
- timeout-minutes: 20 to bound runaway jobs
- fail-fast: false so all matrix combinations surface failures
- matrix conditional: PRs run Linux x {3.11, 3.14} for fast feedback;
  push to main/nightly still runs the full 2-OS x 4-Python matrix

What's intentionally NOT added (each removed for a reason):
- uv cache: depends on uv.lock which is gitignored
- separate lint job: kept inline as a step, matches original
- workflow_dispatch / paths-ignore: scope creep, not needed now

All jobs continue to run on standard GitHub-hosted runners
(ubuntu-latest, windows-latest), keeping CI within the free tier.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-09 08:27:46 +00:00
Xubin Ren
2e8e674e38 revert(ci): restore original Test Suite workflow
The optimized workflow in c01f8599 set astral-sh/setup-uv@v4 with
cache-dependency-glob: "uv.lock", but uv.lock is gitignored in this
repo, so the hosted runner's checkout never contains it and the
Install uv step fails with:

  Error: No file matched to [uv.lock], make sure you have
  checked out the target repository

Reverting the workflow to the pre-c01f8599 version to unbreak CI.

The "Modifying CI Workflows" section added to CONTRIBUTING.md in the
same commit is left in place; it documents general guidance and is
independent of this specific implementation choice.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-09 08:22:09 +00:00
Xubin Ren
c01f85995f ci: optimize Test Suite workflow and document free-tier rule
Workflow changes (.github/workflows/ci.yml):
- Add concurrency to cancel superseded runs on the same ref
- Enable uv dependency caching keyed on uv.lock
- Split lint into a dedicated job; gate test on lint via needs
- Split matrix: PRs run Linux x {3.11, 3.14} for fast feedback;
  push to main/nightly still runs the full 2-OS x 4-Python matrix
- Add fail-fast: false so all platforms surface failures together
- Add timeouts (lint: 5m, test: 20m) to bound runaway jobs
- Tighten GITHUB_TOKEN to contents: read

Docs (CONTRIBUTING.md):
- Add a short "Modifying CI Workflows" section so contributors know
  to stay within standard runners / no metered storage / no paid
  actions before touching .github/workflows/

All jobs continue to run on standard GitHub-hosted runners
(ubuntu-latest, windows-latest), keeping CI within the free tier.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-09 08:15:27 +00:00
yorkhellen
4773589685 fix: F821 undefined name errors in channels 2026-05-07 13:07:22 +08:00
yorkhellen
4a4e0af0ba ci: Enable full ruff -F (all F rules) checks 2026-05-07 13:07:22 +08:00
chengyongru
48692afa38 chore: remove PR template, keep only issue templates 2026-04-19 01:46:14 +08:00
chengyongru
8f383655b5 feat: add issue and PR templates
Add structured issue templates for bug reports and feature requests,
with dropdown menus for channel, LLM provider, Python version, and OS.
Redirect questions to Discussions. Add PR template with checklist.

Ref: https://github.com/HKUDS/nanobot/discussions/3284
2026-04-19 01:46:14 +08:00
Xubin Ren
5badb75f6c review: tighten scope and add regression tests
Follow-ups from review of #3194:

- ci.yml: drop unconditional --ignore=tests/channels/test_matrix_channel.py.
  That test file already calls pytest.importorskip("nio") at module top, so
  it self-skips on Windows (where nio isn't installed) without also hiding
  62 tests from Linux CI.

- filesystem.py: hoist `import os` to the module top and drop the duplicate
  inline import in ReadFileTool.execute. Document the CRLF->LF normalization
  as intentional (primarily a Windows UX fix so downstream StrReplace/Grep
  match consistently regardless of where the file was written).

- test_read_enhancements.py: lock down two new behaviors
  * TestFileStateHashFallback: check_read warns when content changes but
    mtime is unchanged (coarse-mtime filesystems on Windows).
  * TestReadFileLineEndingNormalization: ReadFileTool strips CRLF and
    preserves LF-only files untouched.

- test_tool_validation.py: restore list2cmdline/shlex.quote in
  test_exec_head_tail_truncation. The temp_path-based form was correct,
  but dropping the quoting broke on any Windows path containing spaces
  (e.g. C:\Users\John Doe\...). CI runners happen not to have spaces so
  this slipped through.

Tests: 1993 passed locally.
Made-with: Cursor
2026-04-17 16:11:37 +08:00
Jiajun Xie
3db2eb66e4 ci: add Windows and Python 3.14 support 2026-04-17 16:11:37 +08:00
Jiajun Xie
5ee96721f7 ci: add ruff lint check for unused imports and variables
Add CI step to detect unused imports (F401) and unused variables (F841)
with ruff. Clean up existing violations:

- Remove unused Consolidator import in agent/__init__.py
- Remove unused re import in agent/loop.py
- Remove unused Path import in channels/feishu.py
- Remove unused ContentRepositoryConfigError import in channels/matrix.py
- Remove unused field and CommandHandler imports in channels/telegram.py
- Remove unused exception variable in channels/weixin.py
2026-04-07 13:30:49 +08:00
chengyongru
72acba5d27 refactor(tests): optimize unit test structure 2026-03-24 15:12:22 +08:00
Xubin Ren
d6df665a2c docs: add contributing guide and align CI with nightly branch 2026-03-16 11:13:46 +08:00
Xubin Ren
84b107cf6c fix(ci): upgrade setup-python, add system deps, simplify test assertions 2026-03-13 04:05:08 +00:00
Jiajun Xie
ec6e099393 feat(ci): add GitHub Actions workflow for test directory
- nanobot/channels/matrix.py: Add keyword-only parameters restrict_to_workspace/workspace to MatrixChannel.__init__ and assign them to _restrict_to_workspace/_workspace with proper type conversion and path resolution
- tests/test_commands.py: Add _strip_ansi() function to remove ANSI escape codes, use regex assertions for --workspace/--config parameters to allow 1 or 2 dashes
2026-03-12 21:54:22 +08:00