Bundled Tool Executa with APS KV does not trigger Persistent Storage permission, then fails with storage_token missing

Hi Anna team,

I’m building an Anna App called Form Memory Filler. The app has a bundled Tool Executa called Form Memory Store. The UI calls the tool through AnnaAppRuntime.connect() and anna.tools.invoke(...).

The tool is supposed to save user-approved memory cards into Anna Persistent Storage KV.

Current flow:

Anna App UI
→ anna.tools.invoke
→ bundled Tool Executa: Form Memory Store
→ storage/get or storage/set reverse RPC
→ Anna APS KV

The tool call reaches the Executa, but saving memory fails with:

Memory could not be saved:
{
  'code': 'APS_NOT_CONNECTED',
  'message': 'Anna APS storage is not connected or not granted. Please update/reinstall the app and allow persistent storage permission for Form Memory Store.',
  'details': {
    'host_code': -32021,
    'host_message': 'storage_token missing — host did not authorize storage for this invoke',
    'host_details': {
      'errorCode': 'STORAGE_NOT_GRANTED'
    }
  }
}

The issue seems to be that Anna never shows the Persistent Storage permission prompt for this bundled Executa, unlike the Files via Executa APS example.

My Form Memory Store runtime manifest returned by describe includes:

{
  "name": "form-memory-store",
  "display_name": "Form Memory Store",
  "version": "0.1.0",
  "description": "Stores and retrieves user-approved reusable memory cards for Form Memory Filler.",
  "host_capabilities": ["storage.user", "aps.kv"],
  "storage": {
    "scopes": ["user"],
    "keys": ["memory/cards.v1"]
  },
  "tools": [
    {
      "name": "get_memory",
      "description": "Return all approved memory cards for the current user and Form Memory Filler app.",
      "parameters": []
    },
    {
      "name": "save_approved_memory",
      "description": "Save only memory cards explicitly approved by the user.",
      "parameters": [
        {
          "name": "items",
          "type": "array",
          "required": true
        }
      ]
    },
    {
      "name": "list_memory",
      "description": "Return saved memory cards in a user-friendly preview format.",
      "parameters": [
        {
          "name": "category",
          "type": "string",
          "required": false
        }
      ]
    },
    {
      "name": "delete_memory_item",
      "description": "Delete one saved memory item by ID.",
      "parameters": [
        {
          "name": "id",
          "type": "string",
          "required": true
        }
      ]
    }
  ]
}

The initialize response includes:

{
  "protocolVersion": "2.0",
  "serverInfo": {
    "name": "form-memory-store",
    "version": "0.1.0"
  },
  "capabilities": {
    "storage": {
      "kv": true,
      "scopes": ["user"]
    }
  }
}

The app manifest uses bundled Executas:

{
  "schema": 2,
  "permissions": ["tools.invoke", "storage.read", "storage.write"],
  "required_executas": [
    {
      "tool_id": "bundled:form-memory-store",
      "version": "latest"
    }
  ],
  "ui": {
    "host_api": {
      "tools": ["required:bundled:form-memory-store"]
    }
  }
}

The installed/generated tool ID is:

tool-ervhint-form-memory-store-nrbjrzf3

I also tried adding this to the Executa Hub JSON editor manifest:

"host_capabilities": ["storage.user", "aps.kv"],
"storage": {
  "scopes": ["user"],
  "keys": ["memory/cards.v1"]
}

I rebuilt the binary and updated the binary distribution, but the app still does not show the Persistent Storage permission prompt. The tool is invoked, but APS reverse RPC fails because no storage_token is provided.

Questions:

  1. For a bundled Tool Executa that uses APS KV through storage/get and storage/set, what exact host_capabilities should be used?
  2. Should it be aps.kv, storage.user, or both?
  3. Where does the platform read storage permission metadata from: Executa Hub JSON editor, describe, initialize, app manifest, or server-side Executa row?
  4. How should I trigger or enable the Persistent Storage grant for this bundled Executa?
  5. Is UserExecuta.custom_config.storage_grant.scopes = ["user"] supposed to be exposed in the dashboard for bundled Executas?
  6. Is APS KV supported through anna.tools.invoke from an Anna App UI for bundled Executas, like the APS Files example?
  7. Is there a working APS KV bundled Executa example similar to anna-app-aps-files-demo?

Reference I compared against:

https://github.com/whtcjdtc2007/anna-executa-examples/tree/main/examples/anna-app-aps-files-demo

That example triggers the Persistent Storage permission prompt for aps.files, but my APS KV Executa does not seem to trigger a prompt.

Any guidance would be appreciated. I can share the app ID / tool ID / logs if helpful.

Extra Details To Include

App name: Form Memory Filler
Memory tool ID: tool-ervhint-form-memory-store-nrbjrzf3
Storage key: memory/cards.v1
Scope: user
Reverse RPC methods used: storage/get, storage/set
Distribution: binary
Running environment: Anna web/platform, not local dev

Also attach screenshots of:

  • the STORAGE_NOT_GRANTED error

Hey there :waving_hand: — thanks for the detailed report, and great catch! :raising_hands:

This is expected behavior given how APS permissions are wired, and the good news is it’s a quick fix on your side. Let me walk you through what’s happening. :magnifying_glass_tilted_left:

What’s going on :puzzle_piece:

The “Persistent Storage” permission toggle only appears in your Executa’s Permissions modal when the host actually sees a storage capability in your tool’s manifest. The full chain looks like this:

manifest host_capabilities ➜ Permissions toggle renders ➜ user grants ➜ host mints a short-lived storage_token ➜ token is injected into your invoke params ➜ your APS KV calls succeed :white_check_mark:

If the first link is missing, every link after it silently no-ops:

  • No aps.kv in host_capabilities ➜ no toggle shows up (so nothing “triggers” the permission)
  • No grant ➜ the host never mints storage_token (it’s strictly opt-in + capability-gated)
  • No token in invoke params ➜ your storage call fails with storage token missing :collision:

So the two symptoms you saw — “doesn’t trigger the permission” and “fails with storage token missing” — are actually the same root cause. :bullseye:

The fix :sparkles:

1. Declare the capability in your Executa manifest :memo:

{
  "host_capabilities": ["aps.kv"]   // add "aps.files" too if you use the file API
}

2. Re-publish / re-register the bundled Executa :counterclockwise_arrows_button:

This is the step that’s easy to miss with bundled tools! The host renders the Permissions UI from a cached copy of your manifest ([manifest_cache]). Until you re-publish, it’s still serving the old manifest with no storage capability — so the toggle won’t appear even after step 1. A fresh publish refreshes the cache.

3. Open the Permissions modal and enable it :unlocked:

Go to My Executa → (your tool) → Permissions, flip on Persistent Storage, pick the scope(s) you need (user / app / [tool]), and Save. This is what records the actual grant.

4. Re-run :play_button:

The host will now mint and inject the [storage_token] on each invoke, and your APS KV reads/writes will go through. :tada:

TL;DR :high_voltage:

The toggle and the token are both gated on [host_capabilities] containing aps.kv (or [aps.files]). Add it to your manifest, re-publish the bundled Executa so the cache refreshes, then grant the permission in the Permissions modal. After that, [storage_token] flows automatically. :flexed_biceps:

Give that a try and let us know how it goes — happy to dig deeper if anything’s still stuck! :rocket:

I should’ve put my executa manifest json as evidence in the first place, sorry…

but I did write the host capabilities.
this is my manifest json, from before until now

{
  "name": "form-memory-store",
  "display_name": "Form Memory Store",
  "version": "0.1.0",
  "description": "Stores and retrieves user-approved reusable memory cards for Form Memory Filler.",
  "host_capabilities": [
    "storage.user",
    "aps.kv"
  ],
  "storage": {
    "scopes": [
      "user"
    ],
    "keys": [
      "memory/cards.v1"
    ]
  },
  "tools": [
    {
      "name": "get_memory",
      "description": "Return all approved memory cards for the current user and Form Memory Filler app.",
      "parameters": []
    },
    {
      "name": "save_approved_memory",
      "description": "Save only memory cards explicitly approved by the user.",
      "parameters": [
        {
          "name": "items",
          "type": "array",
          "required": true
        }
      ]
    },
    {
      "name": "list_memory",
      "description": "Return saved memory cards in a user-friendly preview format.",
      "parameters": [
        {
          "name": "category",
          "type": "string",
          "required": false
        }
      ]
    },
    {
      "name": "delete_memory_item",
      "description": "Delete one saved memory item by ID.",
      "parameters": [
        {
          "name": "id",
          "type": "string",
          "required": true
        }
      ]
    }
  ],
  "credentials": []
}

I wrote the host capabilities.

and yes, I’ve rebuild the binary and push the app again, reinstall the executa.

but base from your explanation, I wrote the host capabilities, and yet no permission toggle displayed.

OOHHH, my bad
I keep focusing in tab Executa - My Tools

The permission is located in Executa - Learning

Sorry and thank you!!!