Skip to content

feat: add CrewAI APort task decorator#91

Open
HamidA1998 wants to merge 1 commit into
aporthq:mainfrom
HamidA1998:feature/crewai-task-decorator
Open

feat: add CrewAI APort task decorator#91
HamidA1998 wants to merge 1 commit into
aporthq:mainfrom
HamidA1998:feature/crewai-task-decorator

Conversation

@HamidA1998
Copy link
Copy Markdown

Summary

Closes #30 by adding a CrewAI-focused APort verification decorator under examples/agent-frameworks/crewai.

The integration includes:

  • @aport_verify decorator for sync and async task functions
  • A small dependency-free APortHTTPClient fallback
  • Support for static, callable, kwarg, or environment-derived agent IDs
  • Context builders for passing task-specific facts into APort verification
  • Clear APortVerificationError handling before task execution
  • A runnable example and README usage docs
  • Unit tests covering successful verification, deny responses, derived agent IDs, env agent IDs, strict/non-strict behavior, and async tasks

Validation

  • PYTHONPATH=src python3 -m unittest discover -s tests
  • python3 -m compileall src tests examples
  • PYTHONPATH=src python3 examples/basic_usage.py
  • git diff --check

Copy link
Copy Markdown

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

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: a521a075f5

ℹ️ 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".

_build_context(func, context, args, kwargs),
strict,
)
return func(*args, **kwargs)
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 Strip verification-only kwargs before invoking task

The decorator advertises runtime agent IDs via aport_agent_id/agent_id, but both wrappers forward kwargs unchanged into the task call. For tasks that do not declare these parameters (a common case), calling task(..., aport_agent_id="...") triggers TypeError after verification, so the documented runtime override path is effectively broken unless every task accepts those extra kwargs (or **kwargs). Remove/decorate these internal kwargs before calling the wrapped function.

Useful? React with 👍 / 👎.

@lout33
Copy link
Copy Markdown

lout33 commented May 16, 2026

I would like to work on this. Building the CrewAI task decorator integration now.

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.

[Hacktoberfest] CrewAI Task Verification Decorator

2 participants