Skip to content

fix(tokenless): address code review findings across schema, env-check, hooks, and plugin#538

Merged
Forrest-ly merged 1 commit into
alibaba:mainfrom
shiloong:main
May 15, 2026
Merged

fix(tokenless): address code review findings across schema, env-check, hooks, and plugin#538
Forrest-ly merged 1 commit into
alibaba:mainfrom
shiloong:main

Conversation

@shiloong
Copy link
Copy Markdown
Collaborator

Description

  • schema_compressor: prevent UTF-8 panic on CJK text by using floor_char_boundary before slicing
  • env_check version_ge: handle v-prefixed (v22.1.0) and build-suffix (1.2.3-rc1) version strings in both Rust and shell
  • env_check find_spec_path: return error instead of non-existent fallback path
  • compress_response/toon: route TOON encoding through tokenless compress-toon for proper stats recording and size check
  • openclaw plugin: same TOON routing fix with session/tool-use context
  • tool_ready file_write: fix tmpfile leak and broken perm_missing logic in permission check
  • tool_ready phase 3: re-check version_low and recommended deps after auto-fix; use RECOMMENDED_MISSING_LIST in PARTIAL message
  • extract_missing_cmd: match bash error format ("bash: line 1: foo: command not found") alongside zsh format
  • stats recording: rename after_compact → output_text to record actual output instead of intermediate compact form

Related Issue

bugfix #

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional change)
  • Performance improvement
  • CI/CD or build changes

Scope

  • cosh (copilot-shell)
  • sec-core (agent-sec-core)
  • skill (os-skills)
  • sight (agentsight)
  • tokenless (tokenless)
  • Multiple / Project-wide

Checklist

  • I have read the Contributing Guide
  • My code follows the project's code style
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the documentation accordingly
  • For cosh: Lint passes, type check passes, and tests pass
  • For sec-core (Rust): cargo clippy -- -D warnings and cargo fmt --check pass
  • For sec-core (Python): Ruff format and pytest pass
  • For skill: Skill directory structure is valid and shell scripts pass syntax check
  • For sight: cargo clippy -- -D warnings and cargo fmt --check pass
  • For tokenless: cargo clippy -- -D warnings and cargo fmt --check pass
  • Lock files are up to date (package-lock.json / Cargo.lock)

Testing

全量功能验证完成。汇总如下:

  ┌────────────────────────────────────────────────────────────┬──────┐
  │                           测试项                           │ 结果 │
  ├────────────────────────────────────────────────────────────┼──────┤
  │ tokenless --version (0.3.2)                                │ OK   │
  ├────────────────────────────────────────────────────────────┼──────┤
  │ compress-schema / compress-response / compress-toon --help │ OK   │
  ├────────────────────────────────────────────────────────────┼──────┤
  │ schema 压缩 (strip title/nulls)                            │ OK   │
  ├────────────────────────────────────────────────────────────┼──────┤
  │ response 压缩 (strip debug/nulls)                          │ OK   │
  ├────────────────────────────────────────────────────────────┼──────┤
  │ CJK 截断无 panic (floor_char_boundary)                     │ OK   │
  ├────────────────────────────────────────────────────────────┼──────┤
  │ compress-toon + decompress-toon 往返                       │ OK   │
  ├────────────────────────────────────────────────────────────┼──────┤
  │ stats 记录 (compress-toon 写入记录)                        │ OK   │
  ├────────────────────────────────────────────────────────────┼──────┤
  │ env-check --all --json                                     │ OK   │
  ├────────────────────────────────────────────────────────────┼──────┤
  │ version_ge shell 版: v-prefix / build-suffix / 短版本      │ OK   │
  ├────────────────────────────────────────────────────────────┼──────┤
  │ version_ge Rust 版: cargo test 29 pass (含3个新测试)       │ OK   │
  ├────────────────────────────────────────────────────────────┼──────┤
  │ _extract_missing_cmd: bash/zsh/plain 格式                  │ OK   │
  ├────────────────────────────────────────────────────────────┼──────┤
  │ file_write 权限检查 + tmpfile 清理                         │ OK   │
  ├────────────────────────────────────────────────────────────┼──────┤
  │ openclaw 插件加载                                          │ OK   │
  ├────────────────────────────────────────────────────────────┼──────┤
  │ rtk (0.36.0) / toon (0.4.5) 二进制                         │ OK   │
  ├────────────────────────────────────────────────────────────┼──────┤
  │ Rust unit tests 89 pass (0 fail)                           │ OK   │
  └────────────────────────────────────────────────────────────┴──────┘

  89 tests 全通过,12 项集成功能验证全通过,无回归。

…, hooks, and plugin

- schema_compressor: prevent UTF-8 panic on CJK text by using
  floor_char_boundary before slicing
- env_check version_ge: handle v-prefixed (v22.1.0) and build-suffix
  (1.2.3-rc1) version strings in both Rust and shell
- env_check find_spec_path: return error instead of non-existent
  fallback path
- compress_response/toon: route TOON encoding through
  tokenless compress-toon for proper stats recording and size check
- openclaw plugin: same TOON routing fix with session/tool-use context
- tool_ready file_write: fix tmpfile leak and broken perm_missing
  logic in permission check
- tool_ready phase 3: re-check version_low and recommended deps
  after auto-fix; use RECOMMENDED_MISSING_LIST in PARTIAL message
- extract_missing_cmd: match bash error format ("bash: line 1: foo:
  command not found") alongside zsh format
- stats recording: rename after_compact → output_text to record
  actual output instead of intermediate compact form

Signed-off-by: Shile Zhang <shile.zhang@linux.alibaba.com>
Copy link
Copy Markdown
Collaborator

@Forrest-ly Forrest-ly left a comment

Choose a reason for hiding this comment

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

LGTM

@Forrest-ly Forrest-ly merged commit 717f352 into alibaba:main May 15, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component:tokenless src/tokenless/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants