Skip to content
Skills Library
Programming · Building & coding

bounded-calls

/bounded-calls

Use when one Call spans a loop, a run, or a sequence of operations.

Repository
Agito ↗
Licence
CC0-1.0
Last repository change
13.11.2026

Assessment and security

91/ 100Class: good
Format20 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability21 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
2
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 13.11.2026, without references to retired models or APIs.

Licence

CC0-1.0, otwarta.

What it does and when to use it

Use when one Call spans a loop, a run, or a sequence of operations.

Original author description

Use when one Call spans a loop, a run, or a sequence of operations.

How it works

  1. One Call per operation, never one per run
  2. Prove the page is innocent before blaming it
  3. A handler that ends leaves a connection that lies
  4. What this is not
  5. Claim → test
Original SKILL.md headings · 112 lines, 702 words
SKILL.md preview
---
name: bounded-calls
description: Use when one Call spans a loop, a run, or a sequence of operations.
version: 1.0.0
license: MIT
platforms: [macos, linux]
metadata:
    hermes:
        tags: [rust, agito, call, deadline, budget, cdp]
---

# Bounded Calls

A `Call` is a deadline and a cancellation, and **the deadline is fixed when the `Call` is built**.
Everything below is what a program does to itself by forgetting that one sentence.

---

## One `Call` per operation, never one per run

```rust
// wrong: the deadline is the run's start plus the span
let Bounded = Call::Within(Span, &Tokio, Arc::new(Never));
loop {
    Port.Call(Request, Bounded.clone()).await?;
}

// right: a fresh deadline for the operation being performed
loop {
    let Bounded = Call::Within(Span, &Tokio, Arc::new(Never));
    Port.Call(Request, Bounded).await?;
}
```

`Call::Within(Span, Clock, Cancellation)` evaluates `Deadline = Clock.Now() + Span` in the
constructor, and a clone carries that instant. A run that builds one `Call` and clones it per tick
therefore has a run-length budget wearing a per-tick name.

**The failure it produces is a lie.** Once the single deadline passes, every later call is already
expired, and the error arrives in the provider's vocabulary -
`timeout: evaluate exceeded its deadline`, "the page never answered" - against a page that answered
in a millisecond. The reported subject is the page; the real subject is the caller's arithmetic.

The three signs that separate this from a slow page:

- the failure arrives at a **fixed wall time from process start**, not at a fixed operation count;
- a slower loop reaches the same failure at a **lower operation count** and the same age;
- the last successful operation is **normal** - no latency ramp, no partial result, no warning.

---

## Prove the page is innocent before blaming it

Two clients, one page. The program under test holds one connection; a throwaway script holds a
second, one line a second:

```js
// node, a plain CDP websocket to the page's own webSocketDebuggerUrl
const Ms = Date.now();
const R = await Send("Runtime.evaluate", { expression: "1+1", returnByValue: true });
console.log(Date.now() - Ms, R.result.result.value);
```

If the second client answers in 0-1 ms while the first client's call never returns, the page is
fine: the difference is in the caller - its deadline, its transport, or its handler task. That
measurement costs one line a second and it ends the argument in one direction or the other.

---

## A handler that ends leaves a connection that lies

`chromiumoxide`'s `Handler` is a stream. When it returns `None`, the connection stays open, accepts
commands, and never answers them; each later call then waits out its own deadline, so a dead socket
is reported as a slow page.

Mark the transport closed from the handler task, and check the flag before every call:

```rust
let Closed = Arc::new(AtomicBool::new(false));
let Mark = Closed.clone();
tokio::spawn(async move {
    let mut Handler = Handler;
    loop {
        match Handler.next().await {
            Some(Ok(())) => {},
            Some(Err(Why)) => eprintln!("unreadable message from the browser: {Why}"),
            None => break,
        }
    }
    eprintln!("the connection to the browser ended");
    Mark.store(true, Ordering::SeqCst);
});
```

A panic inside a spawned task is silent by default: the task dies, the channel it served stays open,
and the caller waits. A panic hook is the cheapest way to tell a crash from a stall:

```rust
std::panic::set_hook(Box::new(|Info| eprintln!("panic: {Info}")));
```

---

## What this is not

- **Not a timeout policy.** The span's value is a separate decision. This skill is about _when_ the
  value is computed.
- **Not a retry strategy.** A per-operation deadline makes retries meaningful; it does not add them.
- **Not a claim that every expired call is the caller's fault.** A page that is genuinely busy
  expires too - and it expires in the second client as well, which is the whole reason to run one.

---

## Claim → test

| claim                                               | how it is checked                                                                   |
| --------------------------------------------------- | ----------------------------------------------------------------------------------- |
| a `Call` fixes its deadline at construction         | `Call::Within` body: `Deadline: Clock.Now() + Span`                                 |
| a reused `Call` reports the provider's timeout word | run a loop past the span; the error names the provider's phase, not the caller's    |
| a second client proves the page alive               | two CDP clients: latency of the second while the first hangs                        |
| a dead handler is silent                            | the transport's closed flag is set only by the handler task; check it before a call |
Files in this package (2)
  • SKILL.md 5 KB
  • Reference/Index.md 1 KB

Versions

The database has no other skills named bounded-calls.

Database snapshot: 13.11.2026 · package version 20d97413cd9e (SHA-256 digest of the entire package)

Downloads in the last 30 days: 2 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 86bounded-sequences
    Use when several page operations must run in order, gated and verified.
  • 100actions
    How to create and run agent actions. Actions are the single source of truth for app operations — the agent calls them as tools and frontend code calls them through client hooks. Use when creating a new action, adding an API integration, or wiring up frontend data fetching.
  • 91agent-turn-efficiency
    Use when a short question costs too many tool calls.
  • 100bounded-output-design
    Cap every response so one tool call cannot fill an agent's context window. Use when a tool can return an unbounded list, a full file or a large body
  • 90test-per-ac-planner
    Maps acceptance criteria to specific verification actions. Use when acceptance criteria exist and coding or handoff has not started, above all when work spans several layers.
  • 100actions
    How to create and run agent actions. Actions are the single source of truth for app operations — the agent calls them as tools and frontend code calls them through client hooks. Use when creating a new action, adding an API integration, or wiring up frontend data fetching.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.