Skip to content

Add RV_PACK_RENDER so a library Plugin can render its tools for a model #2

Done

Description

@sharmis-tp

A library Plugin has no way to shape its tools for the model of a section. A linked Pack can do this through Pack::render, given the section entry and the ModelInfo of its first round, but contract 0.6 has no verb that carries it to a library Plugin.

The Plugin that needs it

runvil/web (cppalliance/runvil-plugin-web). With the model's context window it can shorten the web/fetch description and lower the default max_chars for a small-context model, and leave both as they are for a large one.

Proposal for 0.7

A new verb, RV_PACK_RENDER = 7, sent on the pack_run of an instance once for each set a section offers from that Pack, before the first round that sends it.

typedef struct RvPackRenderArgs {
    uint32_t size;
    uint32_t reserved;
    void *ctx;
    RvStr entry;                  /* the section entry, the value Lua reads as sys.id */
    RvStr model;                  /* JSON text: id, description, context, thinking, provider */
    const RvToolInfo *offered;    /* the tools the section offered from this Pack in one set */
    size_t offered_len;
    RvStatus (*add_tool)(void *ctx, const RvToolInfo *info);  /* once per tool the model sees */
} RvPackRenderArgs;
  • One step, with no RV_PENDING: a render only computes.
  • The tools go back through add_tool, as in RV_PACK_NEW, so tool infos keep one form in the contract. The model is JSON text, because it is plain data that grows fields.
  • A Plugin that answers RV_ERR_UNSUPPORTED leaves offered unchanged, so a Plugin with no render writes nothing.
  • The SDK gets Pack::render(&self, cx: RenderContext, offered: Vec<ToolInfo>) -> Vec<ToolInfo>, whose default returns offered, and testing gets a render call that checks it as the loader would.
  • RV_API_MINOR goes to 7, with the header regenerated.

Open questions

  • Should a render be able to add model-only tools, as a linked Pack's render can? If so, the contract needs a second tool flag beside RV_TOOL_CHANGES_FILES, such as RV_TOOL_MODEL_ONLY = 2.
  • Should each RV_TOOL_CALL also name the model of its round? This would be a model field in RvToolCallArgs.

I can open the PR for the contract, the SDK, and testing. The loader side is outside this repository.

Activity

  1. vinniefalco commented on Nov 24, 2026

    @vinniefalco
    Member
    1. Yes, a render should be able to add model-only tools.
    2. The tool call needs to name the model, yes.
    3. I have concerns about RvToolInfo appearing in the parameter list of add_tool. The struct could change and then it may not be clear that the version is different, because the size of RvPackRenderArgs would still be the same.

    I will investigate the contract and reply here.

  2. sharmis-tp commented on Nov 27, 2026

    @sharmis-tp
    Author

    Done in #3. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions