mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-02-11 23:35:25 -05:00
### Background
Input from the input pin is consumed only once, and the default input can always be used. So when you have an input pin overriding the default input, the value will be used only once and the following run will always fall back to the default input. This can mislead the user.
Expected behaviour: the node should NOT RUN, making connected pins only use their connection(s) for sources of data.
### Changes 🏗️
* Make pin connection the mandatory source of input and not falling back to default value.
* Fix the type flakiness on block input & output. Unify the typing for BlockInput & BlockOutput using the right alias to avoid wrong typing.
* Add comment on alias
* automated test on the new behaviour.
34 lines
1.0 KiB
Python
34 lines
1.0 KiB
Python
import pytest
|
|
|
|
from autogpt_server.data import db, graph
|
|
from autogpt_server.executor import ExecutionScheduler
|
|
from autogpt_server.usecases.sample import create_test_graph
|
|
from autogpt_server.util.service import get_service_client
|
|
|
|
|
|
@pytest.mark.asyncio(scope="session")
|
|
async def test_agent_schedule(server):
|
|
await db.connect()
|
|
test_graph = await graph.create_graph(create_test_graph())
|
|
|
|
scheduler = get_service_client(ExecutionScheduler)
|
|
|
|
schedules = scheduler.get_execution_schedules(test_graph.id)
|
|
assert len(schedules) == 0
|
|
|
|
schedule_id = scheduler.add_execution_schedule(
|
|
graph_id=test_graph.id,
|
|
graph_version=1,
|
|
cron="0 0 * * *",
|
|
input_data={"input": "data"},
|
|
)
|
|
assert schedule_id
|
|
|
|
schedules = scheduler.get_execution_schedules(test_graph.id)
|
|
assert len(schedules) == 1
|
|
assert schedules[schedule_id] == "0 0 * * *"
|
|
|
|
scheduler.update_schedule(schedule_id, is_enabled=False)
|
|
schedules = scheduler.get_execution_schedules(test_graph.id)
|
|
assert len(schedules) == 0
|