Skip to content

fix(shell): explain command screen refusals accurately - #314

Merged
Zongwei9888 merged 1 commit into
HKUDS:mainfrom
deosiree:fix/issue-312-accurate-shell-refusal-guidance
Nov 23, 2026
Merged

Zongwei9888 merged 1 commit into
HKUDS:mainfrom
deosiree:fix/issue-312-accurate-shell-refusal-guidance

Conversation

@deosiree

Copy link
Copy Markdown
Contributor

Description

Replace the blanket waiver advice for blocked shell commands with guidance to use a narrower command or ask the user. When a refusal names a DEEPCODE_* variable, clarify that it must be configured by the operator in DeepCode's environment.

Related Issues

Closes #312

Changes Made

  • Update the BashTool policy-screen refusal message.
  • Add assertions for destructive refusals and strict-mode operator settings.

Validation

  • Focused refusal tests: 2 passed.
  • pre-commit run --all-files: passed.
  • tests/test_shell_search_tools.py: 30 passed, 10 skipped, and 5 Windows path-separator failures; all 5 also fail on clean base 806344428369e01425840a73ef120162ee5e4cb0.
  • The full suite was attempted on Windows; existing integration tests emitted 60-second timeout stack dumps.

@Zongwei9888
Zongwei9888 merged commit 0089aa2 into HKUDS:main Nov 23, 2026
@Zongwei9888

Copy link
Copy Markdown
Contributor

Thanks @deosiree, merged on 2026-11-23 as 0089aa2. This fixes #312.

We checked it with a live model (deepseek-flash, three runs before and three after) on a task that asks for rm -rf build/:

  • Before: one run repeated the same command, was blocked twice and told the user a DEEPCODE_* waiver was needed.
  • After: the model deleted the files with narrower commands and did not mention a waiver.

One small follow-up (1e2a93f): the docstrings now use the repository's plain one-line style; the @param/@returns form is not used elsewhere in the code base.

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.

[Bug]: bash tool refusal tells the model to "re-run with the matching DEEPCODE_* waiver", but destructive commands have no waiver

2 participants