Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Add `condition` to `halt_after` / `halt_before`

オープン
#436 コメント 11 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 4 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
55/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
python

調査の方向性

まず app.run、halt_after、halt_before の実装とテストを見つけます。現在のアクションリストがどのように停止を発生させるかを追跡し、条件付きエントリと無条件エントリのカバレッジを定義します。指定された条件を満たした場合にのみ停止が発生し、条件が指定されていない場合は既存の動作が変わらないことを確認できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

area/core kind/feature priority/low

Is your feature request related to a problem? Please describe.
Currently, it is not possible to halt the app after a given action iff a condition is met. Here is a motivating example of when it might be needed:

Say you have a chatgpt-like app with various "chats", where each chat is a distinct burr app. When a user starts a new chat, you'd like to have a quick routing step that will detect, based on the first prompt, if the new chat is actually the continuation of a previous chat. If so, we want to halt the current app and restart the relevant app. If not, the app can continue its normal lifecycle.

Describe the solution you'd like
Instead of providing a list of actions to halt_after (or halt_before), provide a list of tuples (action, condition). The application will halt after a given action if and only if condition is met. If no condition is provided, the app will always halt after action is processed (current behavior).

Describe alternatives you've considered
Right now, the alternative is to have a dummy action to halt on and a conditional transition to it.

with_transitions(
    ("routing_action", "continue_action", when(continue=True)),
    ("routing_action, "halt_action", when(continue=False))
)

And then when calling app.run:

final_action, result, final_state = app.run(
            halt_after=["halt_action"],
            inputs={"prompt" : user_input}
        )

This is less clean than the suggested API.

Another possible way to address this would be to enable halting the application from within an action, although it may be harder to implement.

主要言語
Python
スター
2.6k
フォーク
208
平均マージ
8日 9時間
マージ済み PR(30日)
26

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/burr のほかの issue

apache/burr の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。