AFT's OpenCode bash scanner turns a dynamic redirect target into an external-directory approval for *, which OpenCode renders as Access external directory ..
Repro with AFT bash, from a project directory, with $HOME/foo already existing and not already allowed:
FOO="$HOME/foo"
printf 'x\n' > "$FOO/bar"
Observed with AFT: two approval prompts. First, the extra external-directory prompt:
← Access external directory .
Patterns
- *
Then the normal bash approval prompt for the command itself:
$ FOO="$HOME/foo"
printf 'x\n' > "$FOO/bar"
Without AFT, only the normal bash approval prompt appears for the same command. The command still requires approval, but the confusing wildcard external-directory prompt is gone.
The equivalent direct path prompts correctly:
printf 'x\n' > "$HOME/foo/bar"
That asks for the actual external directory instead of *.
From source, native OpenCode skips dynamic path args and does not inspect redirect targets, while AFT scans redirects and maps dynamic targets to patterns: ["*"].
Expected: avoid the extra broad/misleading external_directory ask. Either resolve simple shell assignments like FOO="$HOME/foo", or match native OpenCode behavior and rely on the bash approval for dynamic targets.
AFT's OpenCode bash scanner turns a dynamic redirect target into an external-directory approval for
*, which OpenCode renders asAccess external directory ..Repro with AFT bash, from a project directory, with
$HOME/fooalready existing and not already allowed:Observed with AFT: two approval prompts. First, the extra external-directory prompt:
Then the normal bash approval prompt for the command itself:
Without AFT, only the normal bash approval prompt appears for the same command. The command still requires approval, but the confusing wildcard external-directory prompt is gone.
The equivalent direct path prompts correctly:
That asks for the actual external directory instead of
*.From source, native OpenCode skips dynamic path args and does not inspect redirect targets, while AFT scans redirects and maps dynamic targets to
patterns: ["*"].Expected: avoid the extra broad/misleading
external_directoryask. Either resolve simple shell assignments likeFOO="$HOME/foo", or match native OpenCode behavior and rely on the bash approval for dynamic targets.