Skip to content

feat(task): work out what a stored task requires by the rule bundle register uses - #389

Merged
earakely-scale merged 2 commits into
mainfrom
feat/stored-task-requires
Oct 29, 2026
Merged

earakely-scale merged 2 commits into
mainfrom
feat/stored-task-requires

Conversation

@earakely-scale

@earakely-scale earakely-scale commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

What

task_requires(steps, declared=()) in agent_env.bundle.requires: what a stored task requires, by the rule bundle register records on the tasks it writes, for a service that saves tasks without a bundle (the hub).

  • The plugin packages behind the task's own step types, and behind the types of the envs and artifacts its steps read, loaded from the store, with the envs and artifacts loading them, or the agents its steps deploy, loaded (a multi env's servers, an MCP server env's or an agent's image).
  • A type only configuration registers never counts, as in register.
  • Ranges across saves: a package declared (what the previous version required) names keeps the range written there; one used anew is at least the installed version; one no longer used is dropped.
  • When a reference can't be read here (an id the run fills in, one the store doesn't hold, a type nothing here registers), every package declared names is kept, since there's no telling whether that reference needs it.

Nothing calls it in core. The hub's sdk calls it from put_task, so every task the hub writes, edits or imports records what it needs, instead of a hub edit dropping what register recorded.

Why here

The detection (Providers, detected) already lives in bundle/requires.py; a stored-task entry point beside it keeps the hub from reading bundle internals or re-implementing the rule.

Tests

tst/unit/bundle/requires_test.py::TestStoredTasks, against fake plugin packages:

  • a registered task's stored steps give exactly the requires registering it recorded (own step type; a referenced artifact type read from the store; core only gives none);
  • a declared range is kept, a package used anew is >= the installed version, an unused one is dropped;
  • a configuration-only step type is never required;
  • a plugin image type an MCP server env or an agent holds is required, though the env's and agent's own types are core's;
  • an absent, templated or unknown-type reference keeps every declared package (an unparseable declared line is still dropped).

make lint, make unit-test.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no new actionable issue was found.

Summary

Adds task_requires(steps, declared) to record the plugin packages a stored task needs.

  • Task-saving services can derive package needs from stored steps.

Reviews (2) · Last reviewed commit: "fix(task): read the agents a stored task..." · Reviewed by Greptile

…egister uses

task_requires(steps, declared) gives the plugin packages behind a task's own step
types and the types of the envs and artifacts its steps read from the store, with
those they hold. A package the previous version required keeps its range; one used
anew is at least the installed version; one no longer used is dropped unless a
reference can't be read here, when every declared one is kept. A service that saves
tasks without a bundle, such as the hub, calls it on every save.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread src/agent_env/bundle/requires.py
…s they hold

An agent can hold an image artifact of a plugin's type, so task_requires now reads
agent references too and walks what the agent holds, as it does for envs. An agent
it can't read keeps every declared package, as any unreadable reference does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@earakely-scale

Copy link
Copy Markdown
Collaborator Author

@greptileai review

@earakely-scale
earakely-scale merged commit 925d15f into main Oct 29, 2026
26 checks passed
@earakely-scale
earakely-scale deleted the feat/stored-task-requires branch October 29, 2026 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant