Skip to content

Add Optional “Deterministic Plan Mode” for Agent Tool Execution #2244

@yuer-dsl

Description

@yuer-dsl

Feature Request: Optional “Deterministic Plan Mode” for Agent Workflows

While experimenting with agent-style tool execution, I noticed that
LLM-driven planning is extremely flexible, but still nondeterministic:

  • Same input can lead to different execution paths
  • Small context shifts can alter the plan
  • Harder to replay, audit, or debug
  • No guaranteed “same request → same route” behavior

This is expected for dynamic reasoning, but some workflows
(e.g., financial, legal, safety-critical, compliance-heavy)
need a deterministically replayable execution trace.


Idea: Add an optional static / compiled plan mode

The idea is not to replace dynamic planning, but to offer
a complementary mode where:

  • the plan is validated once
  • tool calls are explicit and pre-approved
  • execution graph is fixed
  • runtime does not re-plan
  • output is 100% replayable

To explore the concept, I prototyped a tiny minimal executor
that uses a very small “CALL tool(arg)” structured expression:

# deterministic_plan_poc.py
# exploring an optional deterministic execution path

from typing import Callable

TOOLS = {}

def register(name: str):
    def deco(fn: Callable):
        TOOLS[name] = fn
        return fn
    return deco

@register("get_weather")
def get_weather(city: str):
    return f"{city}: clear, 28°C"

@register("get_time")
def get_time(city: str):
    return f"{city}: 2025-11-18 18:88"

def execute(expr: str):
    import re
    m = re.match(r"CALL\s+(\w+)\(([^)]+)\)", expr.strip())
    if not m:
        raise ValueError("invalid expression")
    tool, arg = m.groups()
    if tool not in TOOLS:
        raise PermissionError(f"tool '{tool}' not allowed")
    arg = arg.strip().strip('"')
    result = TOOLS[tool](arg)
    print(f"[exec] {tool}({arg}) -> {result}")
    return result

plan = """
CALL get_weather("Beijing")
CALL get_time("Shanghai")
"""

for line in plan.strip().split("\n"):
    if line.strip():
        execute(line)
Why this might be useful

A deterministic plan mode could help:

improve reproducibility

enable reliable audit logs

support regulated workflows

simplify debugging

enablecompile once, run anywhereagent behavior

This would exist alongside dynamic LLM planning, not replace it.

Question

Has the team explored any internal prototypes or early experiments
around deterministic plan execution?
If so, Id love to read more or see if theres any public discussion.

Thanks for considering!

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