repositories / pi-ext

pi-ext

bugabingas pi extensions

owned by bugabinga

extensions/mode/V3.md

Raw

Mode Extension V3 Ideas

Not approved for implementation. Discussion bucket.

Tool policy syntax

Glob-based allow/deny syntax for tools:

tools: ["*", "!write"]
tools: ["!*", "read", "grep"]

Needs precise ordered semantics and custom-tool behavior.

Open questions:

Tool metadata in active block

V1/V2 intentionally omit tools from the active block.

V3 may reintroduce generated tool metadata if all loaded/custom tools can be tracked safely and cheaply.

Baseline restore/update

V1 restores previous tools/model/thinking on /mode off.

V3 discussion:

Mode-local bash wrappers/guards

Deferred.

This is a permission/sandbox feature in disguise and can create false safety.

Questions:

Historical span toolset metadata

V2 spans include only mode + provider/model.

V3 may add toolset metadata if tool tracking is solved:

<mode_span mode="plan" model="openai/gpt-5.2-codex" tools="ro"/>

Not before tool policy/tracking design is done.

Rich interactive switcher

V1 has a fuzzy picker via /mode select and alt+m.

Future rich picker ideas:

Needs TUI design.

Mode transitions

Possible per-mode transition hooks inside same extension:

No extension-to-extension API.

Mode-scoped prompt templates or skills

Possible but risky.

Questions:

Markdown source
File outline
# Mode Extension V3 Ideas

Not approved for implementation. Discussion bucket.

## Tool policy syntax

Glob-based allow/deny syntax for tools:

```yaml
tools: ["*", "!write"]
tools: ["!*", "read", "grep"]
```

Needs precise ordered semantics and custom-tool behavior.

Open questions:

- Match against all loaded tools or only currently active tools?
- Does `*` include extension/custom tools?
- How to display effective set without confusing the LLM?
- What happens when tools appear after mode activation?

## Tool metadata in active block

V1/V2 intentionally omit tools from the active block.

V3 may reintroduce generated tool metadata if all loaded/custom tools can be tracked safely and cheaply.

## Baseline restore/update

V1 restores previous tools/model/thinking on `/mode off`.

V3 discussion:

- Capture baseline on startup?
- Update baseline while no mode active?
- Detect manual `/model`, thinking, or tools changes while a mode is active?
- Does switching from mode A to mode B restore baseline first, then apply B?

## Mode-local bash wrappers/guards

Deferred.

This is a permission/sandbox feature in disguise and can create false safety.

Questions:

- Is shell allowlisting worth it?
- Is it limited to built-in `bash`?
- How to handle `python -c`, `node -e`, `git`, `tee`, redirection, generated scripts?
- How to communicate limitations without lying?

## Historical span toolset metadata

V2 spans include only mode + provider/model.

V3 may add toolset metadata if tool tracking is solved:

```text
<mode_span mode="plan" model="openai/gpt-5.2-codex" tools="ro"/>
```

Not before tool policy/tracking design is done.

## Rich interactive switcher

V1 has a fuzzy picker via `/mode select` and `alt+m`.

Future rich picker ideas:

- richer picker overlay
- render icon
- render name/id
- render description
- preview model/thinking/tools

Needs TUI design.

## Mode transitions

Possible per-mode transition hooks inside same extension:

- before-enter
- after-enter
- before-exit
- after-exit

No extension-to-extension API.

## Mode-scoped prompt templates or skills

Possible but risky.

Questions:

- Should active mode filter prompt templates/skills?
- Does this mutate Pi resources or only model-visible prompt?
- How to avoid reload/settings mutation?