Skip to content

feat(tinytools-std): file_state, url_guard, detect_tools from OpenHuman; parser regression tests - #33

Merged
senamakel merged 7 commits into
move-openhuman-tool-helpersfrom
oh-extract-leaves
Sep 30, 2026
Merged

senamakel merged 7 commits into
move-openhuman-tool-helpersfrom
oh-extract-leaves

Conversation

@senamakel

Copy link
Copy Markdown
Member

Summary

  • New crate tinytools-std (kept out of the dependency-light tinytools vocabulary crate, so tokio/parking_lot/log do not leak into it) holding host-independent tool building blocks extracted from OpenHuman:
    • file_state: cross-agent read/write stamps, per-path async locks, task-local agent id. init_global(enabled: bool) replaces the OPENHUMAN_FILE_STATE_GUARD env read; the host decides.
    • url_guard: URL validation with SSRF and DNS-rebinding checks (same behaviour and messages).
    • detect_tools: find_on_path and the read-only detect_tools tool.
  • tinytools-agent: adds parser regression cases the host had pinned on its own (large args, special chars, cross-alias closers, raw JSON not a call, empty tool_result / tool_calls, <invoke> forms, fenced JSON) as parse/test/regressions.rs, and pformat registry tests.
  • OpenHuman's command_output copy was already identical to tinytools::command_output, so it is not duplicated here.

Stacking

Base is move-openhuman-tool-helpers (#32): the OpenHuman pin sits on that branch, which is ahead of main.

Verification

cargo fmt --check, cargo clippy -p tinytools-std -p tinytools-agent --all-targets -- -D warnings, cargo test -p tinytools-std (73 passed), cargo test -p tinytools-agent (373 passed).

Co-authored-by: Medulla medulla@tinyhumans.ai

senamakel and others added 7 commits September 30, 2026 03:25
Introduce the tinytools-std crate with modules for command output handling, tool detection, file state management, and URL guarding. This provides the foundational library components for the tinytools project, including tests for each module to ensure basic functionality.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
…ut/mod.rs,crates/tinytools-std/

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
…rates/tinytools-std/src/detect_

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
…rates/tinytools-std/src/detect_

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
…tes/tinytools-agent/src/pformat

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
…tput, detect_tools

Extracted from OpenHuman (host-independent). file_state::init_global now takes an
enabled flag instead of reading OPENHUMAN_FILE_STATE_GUARD. Also adds parser
regression cases and pformat registry tests to tinytools-agent that were only
covered host-side.

Co-authored-by: Medulla <medulla@tinyhumans.ai>
tinytools::command_output has the identical implementation and tests, so the
copy in tinytools-std was redundant.

Co-authored-by: Medulla <medulla@tinyhumans.ai>
@tinysweeper

tinysweeper Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Tiny Sweeper review

⚠️ Review failed for f3fd59720620. the review of #33 did not finish within 900s

@coderabbitai

coderabbitai Bot commented Sep 30, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 73120135-457a-4c57-b255-a6c527412895

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-30T00:45:17.678911Z f3fd597 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f3fd597206

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

}
}

Ok(url)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Bind requests to the vetted DNS result

When a caller passes the returned URL to a normal HTTP client, the hostname is resolved a second time because this function discards addrs and returns only the original URL. A rebinding domain can therefore return a public address during this check and a private address during the client's lookup, bypassing the advertised SSRF protection. Return the vetted addresses for a pinned connection, or perform the request through a connector that preserves Host/SNI while using those addresses.

AGENTS.md reference: AGENTS.md:L61-L63

Useful? React with 👍 / 👎.

Comment on lines +64 to +68
coord.writes.write().insert(
resolved_path.clone(),
WriteStamp {
writer: agent_id.to_string(),
timestamp: now,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve every writer needed by history queries

When agent A writes a path and agent B later writes the same path, this insertion erases A's stamp. As a result, paths_written_by(&[A]) incorrectly omits the path, and parent_stale_files can miss A's stale-parent notification when B is outside the supplied child set, despite both APIs promising historical “all”/“any” behavior. Retain per-writer write history, or otherwise maintain independent attribution data for these queries.

AGENTS.md reference: AGENTS.md:L61-L63

Useful? React with 👍 / 👎.

@senamakel
senamakel merged commit f1985a1 into move-openhuman-tool-helpers Sep 30, 2026
7 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant