Skip to content

feat: issue #32 social media captions generator#37

Open
aalok-p wants to merge 20 commits into
devfrom
feat/caption-generator
Open

feat: issue #32 social media captions generator#37
aalok-p wants to merge 20 commits into
devfrom
feat/caption-generator

Conversation

@aalok-p
Copy link
Copy Markdown
Collaborator

@aalok-p aalok-p commented May 19, 2026

Oxtools Submission

Project name: Social Media Captions #32
Contributor: @aalok-p
Project demo: social media captions


What does this tool do?

Generate platform-optimized captions with hashtag suggestions for YouTube, YouTube Shorts, TikTok, Instagram, LinkedIn, Reddit, and X.


Submission checklist

Check every box before requesting a review. Unchecked items will result in the PR being sent back.

Structure

  • My project is in its own directory under projects/[my-project-name]/
  • I have not placed any files directly in the repository root

Required files

  • Dockerfile is present and docker build . succeeds
  • docker-compose.yml is present and docker compose up starts the app
  • oxlo-manifest.json is present and all fields are filled in
  • .env.example lists every environment variable the project needs (with empty values)
  • README.md is present with setup instructions a reviewer can follow exactly

Security

  • No API keys, private keys, or secrets are hardcoded anywhere in the codebase
  • My actual .env file is not included in this PR
  • I have verified my diff with git grep -i "api_key" and found no leaks

Oxlo API

  • The tool makes at least one functional call to the Oxlo API
  • The API key is read from the OXLO_API_KEY environment variable

For maintainers

  • Security scan passed — no secrets in diff
  • docker build . succeeded locally
  • docker compose up ran successfully and app is reachable
  • Oxlo API integration verified
  • Approved for merge

@vercel
Copy link
Copy Markdown

vercel Bot commented May 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
oxtools Ready Ready Preview, Comment May 19, 2026 6:07pm

Request Review

Copy link
Copy Markdown

@oxlo-ai oxlo-ai Bot left a comment

Choose a reason for hiding this comment

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

OxBot Review

This PR introduces a social media caption generator supporting multiple platforms with OCR and hashtag features, but it suffers from a fundamental architectural mismatch: it presents itself as a standalone community project yet modifies core Tier 1 application code and places files in the shared services directory rather than under projects/. The implementation introduces hardcoded tool-specific logic into the generic tool execution page, duplicates API handling by bypassing existing hooks, and strips critical prompt logic from the registry definition—rendering the tool non-functional. On the Python side, the service makes expensive unbounded LLM calls, lacks input validation and timeouts, and ships an incomplete requirements file. While the concept and helper utilities are solid, the PR requires significant restructuring to align with repository conventions and restore maintainability.

Notes

  • Structural mismatch: Community projects must live under projects/ and must not modify core Tier 1 registry files or the shared tool execution page.
  • The generic tool execution page should remain tool-agnostic; caption-specific UI, API handling, and modals must be extracted into isolated components or driven by configuration rather than inline conditionals.
  • The caption-generator registry definition has been gutted (empty prompts, removed inputs), which will break the tool for all users if merged into the core app.
  • The Python service requirements are insufficient for a FastAPI deployment and the project directory placement contradicts the submission checklist.
  • Resource efficiency and reliability concerns span the Python implementation: unbounded retry loops with up to 9 LLM calls, missing timeouts, and fragile platform normalization need hardening.
  • Cross-file consistency is lacking between the frontend hook expectations, the registry definition, and the Python service interface (e.g., length_type handling, model selection).

⚠️ Verdict: Needs Changes | 21 inline comment(s) | 7 file(s) reviewed | ⏱️ 606s


Automated review by OxBot

Comment thread app/src/app/tools/[toolId]/page.tsx Outdated
return <ToolPageContent toolId={tool.id} />;
}

function VariationCopyButton({ text }: { text: string }) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggestion: navigator.clipboard.writeText can throw if the user denies clipboard permission or if the context is insecure. Wrap this in a try-catch and provide user feedback on failure.

Comment thread app/src/app/tools/[toolId]/page.tsx Outdated

function VariationCopyButton({ text }: { text: string }) {
const [copied, setCopied] = useState(false);
const handleCopy = useCallback(async () => {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: setTimeout updates state after 2 seconds but is never cleaned up. If the component unmounts in that window, React will attempt to set state on an unmounted component. Use a ref or useEffect cleanup to clear the timeout.

@@ -117,6 +310,13 @@ function ToolPageContent({ toolId }: { toolId: string }) {
config={input}
value={fields[input.key] || ""}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: This line appears to be invalid syntax (const custom[REDACTED].getItem(...)). It looks like an assignment was redacted or mangled. It should likely read const customApiKey = localStorage.getItem("oxloApiKey"); or similar.

: {})}
/>
))}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: The response status is not checked before calling response.json(). If the server returns a non-2xx status (e.g., 500 or 404), this may throw or parse an error HTML page. Add if (!response.ok) throw new Error(...) after the fetch.

: {})}
/>
))}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: doExecute sets captionResult directly and then updates result state, which triggers the useEffect at line 259 to re-parse and overwrite captionResult. The effect uses a different fallback for lengthType (data.metadata?.length_type vs || lengthType), causing a potential state desync. Consolidate parsing into a single source of truth.

Comment thread services/python-tools/tools/caption-generator/tool.py
Comment thread services/python-tools/tools/caption-generator/tool.py
Comment thread services/python-tools/tools/caption-generator/tool.py
Comment thread services/python-tools/tools/caption-generator/tool.py
Comment thread services/python-tools/tools/caption-generator/tool.py
aalok-p added 2 commits May 19, 2026 23:16
…nt and result components

Replaces isCaptionGenerator boolean with ToolDefinition config:
- attachable in InputFieldConfig drives inline image attachment
- ResultComponent renders tool-specific results (variations tabs)
- requireLengthSelection triggers length-selector modal

Extracts CaptionResultDisplay to its own component file.
Copy link
Copy Markdown
Collaborator

@ms-shashank ms-shashank left a comment

Choose a reason for hiding this comment

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

LGTM!, Once i will merge your branch and test it on my side and then I will merge it.

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.

2 participants