scheduled_policy
feishu.agent.scheduled_policy
¶
Fail-closed tool access for scheduled executions.
ScheduledToolBlocked
¶
Bases: PermissionError
A tool cannot run under the scheduled task’s policy.
ScheduledContinuationNotReady
¶
Bases: RuntimeError
The original scheduled turn has not finished persisting its wait.
ScheduledDeliveryUnknown
¶
Bases: RuntimeError
A scheduled card may have been delivered, but its outcome is unknown.
ScheduledPolicyRegistry
¶
Expose only permitted tools and prevent direct execution of writes.
The wrapped registry is trusted configuration and must not be exposed to
the model. confirm_writes presents non-read tools as requiring approval,
and permits their dispatch only inside a validated, claimed approval or
previously approved OAuth continuation.
源代码位于: feishu/agent/scheduled_policy.py
current_scheduled_registry
¶
Return the registry scoped to this turn, without affecting other tasks.
scheduled_registry_scope
¶
scheduled_registry_scope(registry: Any, policy: Literal['read_only', 'confirm_writes'], *, lease_validator: Callable[[], None] | None = None) -> Iterator[None]
Apply a scheduled policy only to calls made by the current async task.
源代码位于: feishu/agent/scheduled_policy.py
scheduled_resume_lease
async
¶
scheduled_resume_lease(agent: Any, pending: PendingApproval | PendingAuthorization) -> AsyncIterator[None]
Claim and renew the run while handling a persisted continuation.