close
Skip to content

Tags for actions #468

@elijahbenizzy

Description

@elijahbenizzy

Is your feature request related to a problem? Please describe.
We should be able to tag actions. In particular, this could be used to do halt_after and halt_before.

Describe the solution you'd like

@action(reads=[...], writes=[...], tags=["requires_human_input"])
def act(state: State, human_input: ...) -> State:
    ...

app.run(halt_before=["requires_human_input"])

Would have to do this at the class-level as well, should be straightforward. Also there's the possibility of name-clashes on halt. I'm OK with that due to the simplicity here.

Could also do this at the action level -- in the builder with_actions(some_action=action.with_tags(["requires_human_input"]). Would have to think about how to do this with function-based actions (TBD).

Describe alternatives you've considered
See above

Additional context
Something I've been mulling over for a while.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions