wenjin272 opened a new pull request, #1083: URL: https://github.com/apache/flink-agents/pull/1083
Linked issue: N/A (hotfix) ### Purpose of change Bash can reinterpret values during integer declarations and arithmetic expansion after the original command has passed AST validation. This creates execution paths that are not covered by the command allowlist. This change applies the same fail-closed policy in Java and Python: - reject declaration commands; - reject arithmetic expansions; - reject standalone variable assignments while preserving assignment prefixes attached to an allowed executable; and - add validator and tool-level regression coverage for both indirect evaluation paths. This intentionally makes validation stricter: benign declaration commands, arithmetic expansions, and standalone assignments are also rejected. ### Tests - `pytest -q python/flink_agents/plan/tools/bash/tests/test_bash_tool.py` (46 passed) - `mvn -pl plan -am -DskipITs -Dtest=BashValidatorTest,BashToolTest -Dsurefire.failIfNoSpecifiedTests=false test` (21 passed) - `JAVA_HOME=/Users/jhin/Kit/jdk-17.0.2.jdk/Contents/Home mvn -pl plan -am -DskipITs test` (713 tests, 0 failures/errors, 12 skipped) - `ruff check` and `ruff format --check` for the changed Python files - `git diff --check` ### API No public API changes. Bash tool validation behavior is intentionally stricter. ### Documentation - [ ] `doc-needed` - [x] `doc-not-needed` - [ ] `doc-included` ### Was this patch authored or co-authored using generative AI tooling? - [x] Yes - [ ] No Generated-by: Codex (GPT-5) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
