Skip to content

fix(store): /api/store/resolve 500 from registry.get_app typo#358

Merged
jaylfc merged 2 commits into
masterfrom
fix/store-get-app
May 7, 2026
Merged

fix(store): /api/store/resolve 500 from registry.get_app typo#358
jaylfc merged 2 commits into
masterfrom
fix/store-get-app

Conversation

@jaylfc
Copy link
Copy Markdown
Owner

@jaylfc jaylfc commented May 7, 2026

Fixes #2 — reported by @redkjuegos.

Problem

Every POST /api/store/resolve returned 500:

AttributeError: 'AppRegistry' object has no attribute 'get_app'

AppRegistry exposes .get(app_id) but two callsites were calling the non-existent .get_app(...). This made every Store interaction that hits the resolve endpoint blow up — master-blocking.

Fix

  • routes/store.py:204registry.get_app(manifest_id)registry.get(manifest_id)
  • routes/store_install.py:158-164 — collapsed _registry_get helper: removed the dead hasattr("get_app") branch (always-false), now calls registry.get(app_id) directly

No alias added to AppRegistry — fixed at the callsites.

Regression test

Added test_resolve_returns_200_not_500 and test_resolve_unknown_manifest_returns_404 to tests/test_routes_store.py. These exercise the happy path and 404 path of POST /api/store/resolve end-to-end so this class of typo is caught going forward. All 30 store + registry tests pass.

Summary by CodeRabbit

  • Tests

    • Added regression tests for the /api/store/resolve endpoint to verify correct handling of valid manifest IDs (returning HTTP 200) and invalid manifest IDs (returning HTTP 404).
  • Refactor

    • Standardized manifest retrieval mechanism across store operations for improved consistency.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 7, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 9545f438-d10d-47b3-97e5-e1094df56808

📥 Commits

Reviewing files that changed from the base of the PR and between 5e86fd6 and cb0c7b2.

📒 Files selected for processing (4)
  • tests/routes/test_store_resolve.py
  • tests/test_routes_store.py
  • tinyagentos/routes/store.py
  • tinyagentos/routes/store_install.py

📝 Walkthrough

Walkthrough

The PR refactors manifest lookup calls from registry.get_app() to registry.get() across the store module. The /api/store/resolve endpoint switches its lookup method, a helper function standardizes the pattern in store_install, the test fixture is updated to mock the new method, and two regression tests validate the endpoint behavior for both success and 404 cases.

Changes

Registry Lookup Refactoring

Layer / File(s) Summary
Core Endpoint Implementation
tinyagentos/routes/store.py
/api/store/resolve calls registry.get(manifest_id) instead of registry.get_app(manifest_id).
Helper Standardization
tinyagentos/routes/store_install.py
Added _registry_get(registry, app_id) helper that standardizes manifest lookup to registry.get(app_id).
Test Fixture Update
tests/routes/test_store_resolve.py
fake_registry fixture now mocks reg.get to return the Qwen manifest instead of mocking reg.get_app.
Endpoint Regression Tests
tests/test_routes_store.py
Two new test cases verify /api/store/resolve returns 200 with result and compat fields for valid id, and 404 for unknown id.

Estimated Code Review Effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A registry grows clearer still,
When methods follow one strong will,
From get_app to simple get,
The store resolves without regret!
Tests now guard the path so true.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: fixing a 500 error caused by using the wrong registry method name (get_app instead of get).
Linked Issues check ✅ Passed The PR fixes a production bug preventing store resolution, supporting linked issue #2's objective to validate full install flow and app store functionality.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing the registry.get_app typo across store routes and adding regression tests; no unrelated modifications present.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/store-get-app

Warning

Review ran into problems

🔥 Problems

Timed out fetching pipeline failures after 30000ms


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@kilo-code-bot
Copy link
Copy Markdown

kilo-code-bot Bot commented May 7, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (4 files)
  • tests/test_routes_store.py
  • tests/routes/test_store_resolve.py
  • tinyagentos/routes/store.py
  • tinyagentos/routes/store_install.py

Reviewed by grok-code-fast-1:optimized:free · 143,162 tokens

The fixture was mocking the broken-but-historical .get_app attribute.
After fix(store): registry.get_app -> registry.get the test would have
failed because MagicMock returned a generic Mock from .get instead of
the qwen manifest, and the resolver couldn't iterate .variants. Updates
the fixture to mock the actual API method.
@jaylfc jaylfc merged commit 170adc0 into master May 7, 2026
7 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in TinyAgentOS Roadmap May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

Fresh install test — clean Orange Pi 5 Plus

1 participant