This change is still quite big. I would recommend limiting CLs to ~300 lines or less in the future and splitting up implementation so it's easier to review. Also makes it easier in case a revert is needed. You don't need to implement an entire class in one CL if it's going to be big :)
base::flat_map<TaskId, std::unique_ptr<InFlightAct>> in_flight_acts_;nit: absl::flat_hash_map? TaskId is already used as a key there in actor_ui_state_manager.h.
std::optional<const proto::ObservationConfig*> GetObservationConfigForAct(Returning a pointer into coordinator storage seems easy to misuse, since ResolveYield/CompleteAct/cleanup can free it and a caller holding it across async observation collection would hit a UAF. The nullopt / nullptr / pointer tri-state is also kinda hard to read at call sites. Could this return a small struct by value instead?
uint64_t act_generation,nit: this is act_generation here but generation everywhere else. Can we make these consistent?
ActCallback& callback);Taking the callback by non-const ref and only consuming it on success feels easy to get wrong. Could we take it by value and have the coordinator reply to the overlap itself (like the transport handler does for kInvalidTaskStateForAct), or return base::expected<StartedAct, ActCallback>?
struct StartedAct {Since generation and cleanup are both public, a caller can pass a mismatched generation or forget to move cleanup (which the comment has to warn about). What do you think about making CompleteAct take the StartedAct itself and keeping the members private? Then the destructor is the drop path and the generation can't mismatch.
virtual ~PendingYieldHandler() = default;nit: define the destructor in the .cc.
using ActCallback = base::OnceCallback<void(proto::PerformActionsResponse)>;nit: ActuationDelegate already defines ActCallback and ResolveYieldCallback. Can we alias those instead of redefining them?
// Coordinates in-flight `PerformActions` turns and paused user yields pernit: I'd keep the class comment to what the class is for, and leave the unified responder / popping details to the impl.
if (!handler) {A null handler seems like a caller bug, so CHECK(handler) instead?
if (expire_time.is_null() || expire_time.is_min() || expire_time.is_max() ||nit: is_null/is_min are already covered by the <= now check, and expire_sec <= 0 is covered by truncated_expire <= now. Also is_max gets rejected even though the 24h cap would just clamp it. I think this can just be <= now, clamp, then the truncated check.
// TODO(crbug.com/584863288): Enforce `truncated_expire` via a timer andSince we already send expiration_timestamp_sec to the server, could we at least store truncated_expire on PendingYield and reject in ResolveYield once it's passed? That's a cheap clock check, and the timer can still come in the followup. Otherwise we accept answers after the deadline we advertised.
proto::ResolveYieldResponse::STATUS_YIELD_NOT_FOUND_OR_EXPIRED);nit: this NOT_FOUND response is also built in WrapResolveCallback. Maybe pull it into a small helper?
std::unique_ptr<PendingYield> pending = std::move(in_flight->pending_yield);IIUC if Resolve() rejects the request, we've already moved the pending yield out here, so the handler gets destroyed and the entry is left with no responder and no yield. Then CompleteAct drops the final response, and TryStartAct keeps rejecting new acts for the task as overlap until the batch finishes, so the server has nothing outstanding and can't start anything new. Also not sure the paused action can ever resume once its handler is gone. Could we keep the pending yield on rejection so the server can retry, or pull the drain/defer from the TODO into this CL?
in_flight_acts_.erase(it);If cleanup runs here (batch dropped without CompleteAct), erasing the entry destroys the responder without running it, so the server never gets a reply for that request. Since these are plain OnceCallbacks there's no dropped-callback DCHECK either, so it'd fail silently. Should we run the responder with a failure status before erasing? Would also be good to add a test that drops the StartedAct while a ResolveYield reply is pending.
TEST_F(ActuationYieldCoordinatorTest,Tests cover the main flows, but I think a few edge cases are missing: 1) a cleanup that runs after CompleteAct doesn't erase a newer act for the same task (the main reason for generations), 2) stale-generation CompleteAct/BeginYield are no-ops, 3) re-entrancy (Resolve() calling CompleteAct/BeginYield synchronously, or the coordinator getting destroyed inside Resolve()), 4) CompleteAct while yielded, 5) ResolveYield with no act in flight, 6) sub-second deadlines rejected after truncation and exact seconds for an uncapped expiry. Also the first two tests check a bunch of scenarios each. Could we split them into focused tests and drop the comments in the test bodies?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Addressed all review comments in PS2 (left one follow-up question open on rejected ResolveYield proto semantics).
This change is still quite big. I would recommend limiting CLs to ~300 lines or less in the future and splitting up implementation so it's easier to review. Also makes it easier in case a revert is needed. You don't need to implement an entire class in one CL if it's going to be big :)
Acknowledged — I'll keep future CLs to ~300 lines or less. Keeping this one intact since you've already reviewed it; the other CLs in this stack are already around that size (crrev.com/c/8899432 is +129/-5, crrev.com/c/8898917 is +340/-39, and crrev.com/c/8893465 is +312/-17).
base::flat_map<TaskId, std::unique_ptr<InFlightAct>> in_flight_acts_;nit: absl::flat_hash_map? TaskId is already used as a key there in actor_ui_state_manager.h.
Done — switched in_flight_acts_ to absl::flat_hash_map.
std::optional<const proto::ObservationConfig*> GetObservationConfigForAct(Returning a pointer into coordinator storage seems easy to misuse, since ResolveYield/CompleteAct/cleanup can free it and a caller holding it across async observation collection would hit a UAF. The nullopt / nullptr / pointer tri-state is also kinda hard to read at call sites. Could this return a small struct by value instead?
Done — replaced GetObservationConfigForAct() with GetObservationPolicyForAct(), returning a small ObservationPolicy struct by value.
nit: this is act_generation here but generation everywhere else. Can we make these consistent?
Done — renamed act_generation to generation.
Taking the callback by non-const ref and only consuming it on success feels easy to get wrong. Could we take it by value and have the coordinator reply to the overlap itself (like the transport handler does for kInvalidTaskStateForAct), or return base::expected<StartedAct, ActCallback>?
Done — TryStartAct() now takes ActCallback by value and returns base::expected<StartedAct, ActCallback>.
Since generation and cleanup are both public, a caller can pass a mismatched generation or forget to move cleanup (which the comment has to warn about). What do you think about making CompleteAct take the StartedAct itself and keeping the members private? Then the destructor is the drop path and the generation can't mismatch.
Done — made StartedAct a class with private members (keeping a read-only generation() getter for observation-policy lookups and deleting unused move-assignment), and changed CompleteAct() to take StartedAct by value and disarm its cleanup.
nit: define the destructor in the .cc.
Done — defined PendingYieldHandler::~PendingYieldHandler() in the .cc.
using ActCallback = base::OnceCallback<void(proto::PerformActionsResponse)>;nit: ActuationDelegate already defines ActCallback and ResolveYieldCallback. Can we alias those instead of redefining them?
Done — aliased ActuationDelegate::ActCallback and ActuationDelegate::ResolveYieldCallback.
// Coordinates in-flight `PerformActions` turns and paused user yields pernit: I'd keep the class comment to what the class is for, and leave the unified responder / popping details to the impl.
Done — trimmed the header comment to what the class is for and moved the responder/popping details into the .cc.
A null handler seems like a caller bug, so CHECK(handler) instead?
Done — changed to CHECK(handler).
if (expire_time.is_null() || expire_time.is_min() || expire_time.is_max() ||nit: is_null/is_min are already covered by the <= now check, and expire_sec <= 0 is covered by truncated_expire <= now. Also is_max gets rejected even though the 24h cap would just clamp it. I think this can just be <= now, clamp, then the truncated check.
Done — simplified to expire_time <= now, clamp to 24h (including Time::Max()), then truncated_expire <= now.
// TODO(crbug.com/584863288): Enforce `truncated_expire` via a timer andSince we already send expiration_timestamp_sec to the server, could we at least store truncated_expire on PendingYield and reject in ResolveYield once it's passed? That's a cheap clock check, and the timer can still come in the followup. Otherwise we accept answers after the deadline we advertised.
Done — stored truncated_expire on PendingYield and added the clock check in ResolveYield().
proto::ResolveYieldResponse::STATUS_YIELD_NOT_FOUND_OR_EXPIRED);nit: this NOT_FOUND response is also built in WrapResolveCallback. Maybe pull it into a small helper?
Done — extracted MakeYieldNotFoundResponse().
std::unique_ptr<PendingYield> pending = std::move(in_flight->pending_yield);IIUC if Resolve() rejects the request, we've already moved the pending yield out here, so the handler gets destroyed and the entry is left with no responder and no yield. Then CompleteAct drops the final response, and TryStartAct keeps rejecting new acts for the task as overlap until the batch finishes, so the server has nothing outstanding and can't start anything new. Also not sure the paused action can ever resume once its handler is gone. Could we keep the pending yield on rejection so the server can retry, or pull the drain/defer from the TODO into this CL?
Done — rejected Resolve() now restores pending_yield and the previous observation_config before replying STATUS_YIELD_NOT_FOUND_OR_EXPIRED, so the server can retry until expiration (and crrev.com/c/8898917 no longer needs a rejected-resolve drain path, just restarting the expiry timer). One follow-up note: STATUS_YIELD_NOT_FOUND_OR_EXPIRED in actuation_transport.proto currently documents an unknown opaque_choice_id under "The browser has no such yield". Before wiring BeginYield in the next CL, would you prefer clarifying that proto comment to note rejected choices leave the yield retryable, or adding a distinct retryable status so the server can tell "retry choice" from "yield gone"?
If cleanup runs here (batch dropped without CompleteAct), erasing the entry destroys the responder without running it, so the server never gets a reply for that request. Since these are plain OnceCallbacks there's no dropped-callback DCHECK either, so it'd fail silently. Should we run the responder with a failure status before erasing? Would also be good to add a test that drops the StartedAct while a ResolveYield reply is pending.
Done — OnStartedActDropped() now invokes any live responder with STATUS_TASK_CANCELLED / kActionsCancelled before erasing (matching the adapter's kActionsCancelled mapping and keeping active_tasks_ intact), and added DroppedStartedActWhileResolvePendingFailsResolve.
Tests cover the main flows, but I think a few edge cases are missing: 1) a cleanup that runs after CompleteAct doesn't erase a newer act for the same task (the main reason for generations), 2) stale-generation CompleteAct/BeginYield are no-ops, 3) re-entrancy (Resolve() calling CompleteAct/BeginYield synchronously, or the coordinator getting destroyed inside Resolve()), 4) CompleteAct while yielded, 5) ResolveYield with no act in flight, 6) sub-second deadlines rejected after truncation and exact seconds for an uncapped expiry. Also the first two tests check a bunch of scenarios each. Could we split them into focused tests and drop the comments in the test bodies?
Done — split into 18 focused tests without in-body comments covering all 6 edge cases (with CompleteAct taking StartedAct by value, moved-from StartedAct plus stale-generation BeginYield/GetObservationPolicyForAct cover the generation isolation cases; also added re-entrancy tests for CompleteAct, BeginYield, and coordinator destruction inside Resolve(), CompleteAct while yielded, ResolveYield with no act in flight, and sub-second/uncapped/24h-cap/Time::Max() deadlines).
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
- `GetObservationConfigForAct()` and `CompleteAct()` expose the activeThe description is a bit stale now. It still mentions GetObservationConfigForAct() (now GetObservationPolicyForAct()) and the StartedAct::cleanup closure, and doesn't mention that dropped acts now reply cancelled or that rejected resolves stay retryable.
ActuationYieldCoordinator::~ActuationYieldCoordinator() = default;Since this is defaulted, any live responder gets destroyed without running when the coordinator goes away (same as the silent drop fixed for dropped StartedActs). Could we move the map out here and reply TASK_CANCELLED to any live responders?
If the owner's teardown order will guarantee the transport is gone by this point, then this is probably moot. Might still be good to include as a guarantee, though.
if (in_flight.pending_yield || !in_flight.responder) {nit: since the responder is always null while a yield is pending, I think this can just check !in_flight.responder.
std::unique_ptr<PendingYield> pending = std::move(in_flight->pending_yield);Sergio VasquezIIUC if Resolve() rejects the request, we've already moved the pending yield out here, so the handler gets destroyed and the entry is left with no responder and no yield. Then CompleteAct drops the final response, and TryStartAct keeps rejecting new acts for the task as overlap until the batch finishes, so the server has nothing outstanding and can't start anything new. Also not sure the paused action can ever resume once its handler is gone. Could we keep the pending yield on rejection so the server can retry, or pull the drain/defer from the TODO into this CL?
Done — rejected Resolve() now restores pending_yield and the previous observation_config before replying STATUS_YIELD_NOT_FOUND_OR_EXPIRED, so the server can retry until expiration (and crrev.com/c/8898917 no longer needs a rejected-resolve drain path, just restarting the expiry timer). One follow-up note: STATUS_YIELD_NOT_FOUND_OR_EXPIRED in actuation_transport.proto currently documents an unknown opaque_choice_id under "The browser has no such yield". Before wiring BeginYield in the next CL, would you prefer clarifying that proto comment to note rejected choices leave the yield retryable, or adding a distinct retryable status so the server can tell "retry choice" from "yield gone"?
I'd lean towards adding a distinct retryable status (ex: STATUS_INVALID_ANSWER) rather than just updating the comment. Right now the server gets NOT_FOUND_OR_EXPIRED, which the proto says means the yield is gone, so it'll probably give up while Chrome keeps the batch paused (and blocks new acts for the task) until expiry, which can be up to 24h. A separate status lets the server tell "retry the choice" apart from "yield gone".
std::move(*first), // NOLINT(bugprone-use-after-move)nit: instead of testing a moved-from token here (with the NOLINT), what do you think about CHECKing that the generation is non-zero in CompleteAct? Then passing a moved-from token is just a caller bug and this test can go away.
TEST_F(ActuationYieldCoordinatorTest,nit: this one and the cap test below each check 3-4 deadline cases. Could we split them into one test per case?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Addressed comments and updated the CL description; PTAL for re-LGTM (code diff reset Code-Review+1).
- `GetObservationConfigForAct()` and `CompleteAct()` expose the activeThe description is a bit stale now. It still mentions GetObservationConfigForAct() (now GetObservationPolicyForAct()) and the StartedAct::cleanup closure, and doesn't mention that dropped acts now reply cancelled or that rejected resolves stay retryable.
Done — updated the CL description to reflect `GetObservationPolicyForAct()`, `STATUS_TASK_CANCELLED` on dropped acts, retryable rejected resolves, and silent destructor teardown.
ActuationYieldCoordinator::~ActuationYieldCoordinator() = default;Since this is defaulted, any live responder gets destroyed without running when the coordinator goes away (same as the silent drop fixed for dropped StartedActs). Could we move the map out here and reply TASK_CANCELLED to any live responders?
If the owner's teardown order will guarantee the transport is gone by this point, then this is probably moot. Might still be good to include as a guarantee, though.
Kept the destructor silent and documented the teardown contract in the header — invoking arbitrary responder callbacks during destruction risks re-entering a partially destroyed owner (and crrev.com/c/8898917 explicitly tests that destruction does not invoke resolve callbacks).
if (in_flight.pending_yield || !in_flight.responder) {nit: since the responder is always null while a yield is pending, I think this can just check !in_flight.responder.
Done — simplified to `!in_flight.responder` (and `in_flight.draining || !in_flight.responder` in crrev.com/c/8898917).
std::unique_ptr<PendingYield> pending = std::move(in_flight->pending_yield);Sergio VasquezIIUC if Resolve() rejects the request, we've already moved the pending yield out here, so the handler gets destroyed and the entry is left with no responder and no yield. Then CompleteAct drops the final response, and TryStartAct keeps rejecting new acts for the task as overlap until the batch finishes, so the server has nothing outstanding and can't start anything new. Also not sure the paused action can ever resume once its handler is gone. Could we keep the pending yield on rejection so the server can retry, or pull the drain/defer from the TODO into this CL?
Chase HartsellDone — rejected Resolve() now restores pending_yield and the previous observation_config before replying STATUS_YIELD_NOT_FOUND_OR_EXPIRED, so the server can retry until expiration (and crrev.com/c/8898917 no longer needs a rejected-resolve drain path, just restarting the expiry timer). One follow-up note: STATUS_YIELD_NOT_FOUND_OR_EXPIRED in actuation_transport.proto currently documents an unknown opaque_choice_id under "The browser has no such yield". Before wiring BeginYield in the next CL, would you prefer clarifying that proto comment to note rejected choices leave the yield retryable, or adding a distinct retryable status so the server can tell "retry choice" from "yield gone"?
I'd lean towards adding a distinct retryable status (ex: STATUS_INVALID_ANSWER) rather than just updating the comment. Right now the server gets NOT_FOUND_OR_EXPIRED, which the proto says means the yield is gone, so it'll probably give up while Chrome keeps the batch paused (and blocks new acts for the task) until expiry, which can be up to 24h. A separate status lets the server tell "retry the choice" apart from "yield gone".
Sounds good — added a `TODO(crbug.com/584863288)` here to switch to `STATUS_INVALID_ANSWER` in a separate proto + wiring follow-up before wiring `BeginYield()` so this stack stays unblocked.
std::move(*first), // NOLINT(bugprone-use-after-move)nit: instead of testing a moved-from token here (with the NOLINT), what do you think about CHECKing that the generation is non-zero in CompleteAct? Then passing a moved-from token is just a caller bug and this test can go away.
Done — replaced the `generation == 0` early return with `CHECK_NE(generation, 0u)` in `CompleteAct()` and removed the `NOLINT` moved-from test.
TEST_F(ActuationYieldCoordinatorTest,Sergio Vasqueznit: this one and the cap test below each check 3-4 deadline cases. Could we split them into one test per case?
Done — split both tests into 7 single-case deadline/cap tests.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Rebased onto main (resolving BUILD.gn conflict) and wired STATUS_INVALID_ANSWER on rejected Resolve() now that crrev.com/c/8902660 landed (removing the TODO). PTAL for re-LGTM.
| Commit-Queue | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
#include "base/check.h"
#include "base/check_op.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/functional/callback_helpers.h"
#include "base/time/time.h"
#include "base/types/expected.h"
#include "base/types/optional_util.h"
#include "base/uuid.h"
#include "components/actor/public/mojom/actor_types.mojom.h"
#include "components/actor/transport/proto/actuation_transport.pb.h"
Please fix this WARNING reported by Chromium Code Review Agent: `actuation_yield_coordinator.cc` directly uses `TaskId` (e.g., lines 129, 137, 1...
`actuation_yield_coordinator.cc` directly uses `TaskId` (e.g., lines 129, 137, 149) and `base::WeakPtr` (line 266) without directly `#include`ing their headers, relying on transitive inclusions through `actuation_yield_coordinator.h`. Per include-what-you-use, `.cc` files should directly include headers for all symbols they use so headers remain self-contained and future refactors do not break compilation.
Add direct includes for `"base/memory/weak_ptr.h"` and `"components/actor/core/task_id.h"`.
KB rule: styleguide/cpp/headers/include-what-you-use
Why: Avoiding transitive inclusion reliance keeps headers self-contained and lets authors remove no-longer-needed `#include` statements without breaking downstream files.
ref: f/38108daa
auto started =
coordinator_.TryStartAct(kTaskId, &none_config, act_future.GetCallback());
ASSERT_TRUE(started.has_value());Please fix this INFO reported by Chromium Code Review Agent: Avoid using `auto` when the deduced type (`base::expected<StartedAct, ActuationY...
Avoid using `auto` when the deduced type (`base::expected<StartedAct, ActuationYieldCoordinator::ActCallback>`) is not obvious from the `TryStartAct()` initializer. Several other tests in this file (e.g., lines 255, 270, 285, 306, 322, 339, 358) already spell out the explicit type; consider spelling it out here as well (or introducing a local type alias in the anonymous namespace) for readability and consistency.
Also occurs at `chrome/browser/actor/transport/actuation_yield_coordinator_unittest.cc`: lines 141, 146, 156, 172, 185, 199, 227, 234, 380, 459, 494, 527, 583, 637, 667, 696, and 740.
KB rule: styleguide/cpp/features/auto-only-when-type-is-obvious-or-irrelevant
Why: C++ code is usually clearer when types are explicit, especially when deduction depends on information from distant parts of the code. Readers are not necessarily on your team, so types that feel like clutter to the author and reviewer often give others useful information.
ref: f/4f8d31e0
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Addressed both IWYU and explicit-type comments in PS10.
#include "base/check.h"
#include "base/check_op.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/functional/callback_helpers.h"
#include "base/time/time.h"
#include "base/types/expected.h"
#include "base/types/optional_util.h"
#include "base/uuid.h"
#include "components/actor/public/mojom/actor_types.mojom.h"
#include "components/actor/transport/proto/actuation_transport.pb.h"
Please fix this WARNING reported by Chromium Code Review Agent: `actuation_yield_coordinator.cc` directly uses `TaskId` (e.g., lines 129, 137, 1...
`actuation_yield_coordinator.cc` directly uses `TaskId` (e.g., lines 129, 137, 149) and `base::WeakPtr` (line 266) without directly `#include`ing their headers, relying on transitive inclusions through `actuation_yield_coordinator.h`. Per include-what-you-use, `.cc` files should directly include headers for all symbols they use so headers remain self-contained and future refactors do not break compilation.
Add direct includes for `"base/memory/weak_ptr.h"` and `"components/actor/core/task_id.h"`.
KB rule: styleguide/cpp/headers/include-what-you-use
Why: Avoiding transitive inclusion reliance keeps headers self-contained and lets authors remove no-longer-needed `#include` statements without breaking downstream files.
ref: f/38108daa
Done — added direct includes for "base/memory/weak_ptr.h" and "components/actor/core/task_id.h".
auto started =
coordinator_.TryStartAct(kTaskId, &none_config, act_future.GetCallback());
ASSERT_TRUE(started.has_value());Please fix this INFO reported by Chromium Code Review Agent: Avoid using `auto` when the deduced type (`base::expected<StartedAct, ActuationY...
Avoid using `auto` when the deduced type (`base::expected<StartedAct, ActuationYieldCoordinator::ActCallback>`) is not obvious from the `TryStartAct()` initializer. Several other tests in this file (e.g., lines 255, 270, 285, 306, 322, 339, 358) already spell out the explicit type; consider spelling it out here as well (or introducing a local type alias in the anonymous namespace) for readability and consistency.
Also occurs at `chrome/browser/actor/transport/actuation_yield_coordinator_unittest.cc`: lines 141, 146, 156, 172, 185, 199, 227, 234, 380, 459, 494, 527, 583, 637, 667, 696, and 740.
KB rule: styleguide/cpp/features/auto-only-when-type-is-obvious-or-irrelevant
Why: C++ code is usually clearer when types are explicit, especially when deduction depends on information from distant parts of the code. Readers are not necessarily on your team, so types that feel like clutter to the author and reviewer often give others useful information.
ref: f/4f8d31e0
Done — introduced a local TryStartActResult alias and replaced all auto TryStartAct() declarations across the file.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
9 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:
```
The name of the file: chrome/browser/actor/transport/actuation_yield_coordinator_unittest.cc
Insertions: 28, Deletions: 26.
The diff is too large to show. Please review the diff.
```
```
The name of the file: chrome/browser/actor/transport/actuation_yield_coordinator.cc
Insertions: 2, Deletions: 0.
The diff is too large to show. Please review the diff.
```
[actor] Add ActuationYieldCoordinator core turn and yield lifecycle
Introduces `ActuationYieldCoordinator` under
`chrome/browser/actor/transport/` to manage per-task in-flight
`PerformActions` turns and generic user yields:
- Tracks one in-flight turn per `TaskId` via `TryStartAct()`,
returning `base::expected<StartedAct, ActCallback>` so overlapping
`Act()` calls can be rejected with the returned callback.
- Encapsulates the RAII `StartedAct` token: passing it to
`CompleteAct()` delivers the final response, while dropping an
uncompleted token cleans up the in-flight entry and replies
`STATUS_TASK_CANCELLED` (`kActionsCancelled`) to any live responder.
- Supports `BeginYield()` (validating and clamping deadlines to 24h)
and `ResolveYield()` (updating `ObservationConfig`, keeping the
pending yield active for retry if `PendingYieldHandler::Resolve()`
rejects the request, and supporting synchronous completion or nested
yields).
- Exposes `GetObservationPolicyForAct()` by value so callers evaluate
the active `ObservationConfig` at action completion time.
- Destroying the coordinator silently drops pending yields and live
responders without invoking callbacks.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |