Skip to content

AFT bash shows wildcard external-directory approval for dynamic redirect path #135

Description

@azkore

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions