Skip to content

feat: consolidate meal tools with discovery - #195

Merged
QueryPlanner merged 2 commits into
mainfrom
feat/meals-domain-tool
Oct 23, 2026
Merged

QueryPlanner merged 2 commits into
mainfrom
feat/meals-domain-tool

Conversation

@QueryPlanner

@QueryPlanner QueryPlanner commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

What

Replace the seven model-facing meal/calorie functions with meals(action, arguments) and read-only describe_action(domain, action). This PR is the meals-only pilot; training, sandbox/browser, and other domain interfaces are unchanged.

Why

The model currently receives every meal action schema on each request. Selective discovery reduces the initial meals schema from 820–850 tokenizer-estimated tokens to 188–190, including discovery, approximately 77%.

This does not establish a production cost reduction. Controlled ADK replays reduce total input by approximately 6% when the action can be called directly. Adding a discovery round trip increases input by approximately 43–45% for the two short workflows measured. The benchmark documents the full context and limits. Expansion to other domains remains gated on representative real-model evaluation.

How

  • Generate strict Pydantic argument validation and discovery schemas from the existing handlers. Reject unknown actions, extra fields, invalid types, and injected context before dispatch. Actions with no parameters accept omitted or null arguments.
  • Keep the original authenticated ADK context and existing storage, ownership, private-chat, Google Health queue, and partial-success behavior.
  • Classify both model-facing tools as private. Resolve known action identities for Telegram progress and per-invocation retry guards through lightweight metadata.
  • Update nutrition instructions and existing evaluation fixtures to use the domain interface.
  • Cover real SQLite mutation/export behavior, no-write rejection, cross-user isolation, metadata-only discovery, DEBUG-level privacy, action retry isolation, and completed historical leaf-tool conversations through a real ADK runner.
  • Add a reproducible local replay harness and architecture/measurement documentation. The tokenizer runs as an isolated benchmark dependency; application dependencies and the lockfile do not change.

Strict validation intentionally rejects numeric strings, floating-point values, or booleans for integer parameters. The conversation continuation test covers completed old calls/responses; it does not establish resumption of suspended calls to removed leaf-tool names.

Tests

  • uv run ruff format
  • uv run ruff check
  • uv run mypy .
  • uv run pytest --cov=src --cov-report=xml --cov-report=term-missing
  • uv run --with tiktoken==0.12.0 python scripts/benchmark_meal_tools.py
  • Strict MkDocs build in an isolated docs environment; bash -n setup.sh entrypoint.sh
  • GitHub CI: Python lint/type/tests, strict docs build, and deployment contract with Docker build/startup/exporter checks
  • Independent review of privacy, dispatch, retry, import, and history boundaries; resolve the identified import coupling and benchmark reproducibility findings.

The full suite passes with 2,237 passed, 1 skipped, and 100% statement and branch coverage. Local Docker was unavailable; the complete deployment-contract job passed in GitHub CI. No live model, paid-provider, production-latency, deployment, or billing claim is made by the scripted benchmark.

Related Issues

No linked issue. This implements the requested meals-domain discovery pilot.

- Route meal actions through validated domain dispatch
- Preserve privacy, user context, and action retry handling
- Cover storage, discovery, history, and schema savings
- Document discovery overhead with a reproducible benchmark
@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@QueryPlanner

Copy link
Copy Markdown
Owner Author

@codex review

Repository owner deleted a comment from ChiragPatil-WeberShandwick Oct 23, 2026
@chatgpt-codex-connector

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 ⚠️ Failed 2026-10-23T11:31:07.947051Z
We couldn’t complete this review. Comment @codex review to try again.
fcb53be Manual request
ℹ️ 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

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

- Default missing or null arguments to an empty object
- Add zero-argument dispatch tests for meal sync actions
- Cover nutrition policy routing with the compact meals tool
- Clarify benchmark tool counts for the measured payload
@QueryPlanner
QueryPlanner merged commit 9b2f8af into main Oct 23, 2026
3 checks passed
@QueryPlanner
QueryPlanner deleted the feat/meals-domain-tool branch October 23, 2026 11:58
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