Skip to content

Conversation

@m-y-mo
Copy link
Contributor

@m-y-mo m-y-mo commented Oct 23, 2025

This allows toolboxes, taskflows etc. to be referenced using a simplied and shortened id specified either in a config file or in the yaml file itself. A bit like using namespace in c++ or import packages as p in python.

Copilot AI review requested due to automatic review settings October 23, 2025 12:00
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements namespace aliasing functionality to simplify references to taskflows, toolboxes, and personalities. Instead of using full paths like GitHubSecurityLab/seclab-taskflow-agent/toolboxes/memcache, users can define shorter aliases (e.g., seclab-ta) either inline in YAML files or via a centralized namespace configuration file.

Key Changes:

  • Added support for namespace_aliases field in YAML files and namespace_config file reference
  • Implemented alias resolution mechanism through copy_with_alias() and canonicalize_toolboxes() functions
  • Updated toolbox and resource references to use the shortened alias format

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
taskflows/examples/example.yaml Demonstrates namespace_config usage and applies alias to toolbox reference
taskflows/examples/echo.yaml Shows inline namespace_aliases definition and applies alias to agent reference
personalities/examples/echo.yaml Demonstrates inline namespace_aliases in personality files with alias applied to toolbox
main.py Integrates namespace alias resolution into taskflow processing and agent deployment
configs/namespace_config.yaml New centralized namespace configuration file defining the GitHubSecurityLab→seclab-ta alias
available_tools.py Implements core aliasing logic with copy_with_alias() and canonicalize_toolboxes() functions

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

for tb in toolboxes:
found_alias = False
for k,v in alias_dict.items():
if tb.startswith(v) and tb[len(v)] == '/':
Copy link

Copilot AI Oct 23, 2025

Choose a reason for hiding this comment

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

This code will raise an IndexError if the toolbox name equals the alias value exactly (without a trailing path). Add a length check: if tb.startswith(v) and len(tb) > len(v) and tb[len(v)] == '/':

Copilot uses AI. Check for mistakes.
alias_keys = alias_dict.keys()
for k,v in original_dict.items():
for ak in alias_keys:
if k.startswith(ak) and k[len(ak)] == '/':
Copy link

Copilot AI Oct 23, 2025

Choose a reason for hiding this comment

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

This will raise an IndexError if a key equals the alias exactly. Add a length check: if k.startswith(ak) and len(k) > len(ak) and k[len(ak)] == '/':

Suggested change
if k.startswith(ak) and k[len(ak)] == '/':
if k.startswith(ak) and len(k) > len(ak) and k[len(ak)] == '/':

Copilot uses AI. Check for mistakes.
m-y-mo and others added 2 commits October 23, 2025 12:07
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Comment on lines +72 to +77
alias_keys = alias_dict.keys()
for k,v in original_dict.items():
for ak in alias_keys:
if k.startswith(ak) and len(k) > len(ak) and k[len(ak)] == '/':
new_key = alias_dict[ak] + k[len(ak):]
new_dict[new_key] = v
Copy link
Collaborator

Choose a reason for hiding this comment

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

The loop over alias_keys looks inefficient. I think something like this would be better:

Suggested change
alias_keys = alias_dict.keys()
for k,v in original_dict.items():
for ak in alias_keys:
if k.startswith(ak) and len(k) > len(ak) and k[len(ak)] == '/':
new_key = alias_dict[ak] + k[len(ak):]
new_dict[new_key] = v
for k,v in original_dict.items():
ak = k.split('/')[0]
av = alias_dict[ak]
if alias_value:
new_key = av + k[len(ak):]
new_dict[new_key] = v

return toolboxes
for tb in toolboxes:
found_alias = False
for k,v in alias_dict.items():
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same comment as above about looping over all the aliases.

@kevinbackhouse
Copy link
Collaborator

smoke test

@github-actions
Copy link

⚠️ Cannot proceed with deployment

Your branch is behind the base branch and will need to be updated before deployments can continue.

  • mergeStateStatus: BLOCKED
  • update_branch: warn

Please ensure your branch is up to date with the main branch and try again

@kevinbackhouse
Copy link
Collaborator

smoke test

@JarLob
Copy link
Contributor

JarLob commented Oct 24, 2025

smoke test

@github-actions
Copy link

⚠️ Cannot proceed with deployment

  • reviewDecision: REVIEW_REQUIRED
  • commitStatus: SUCCESS

CI checks are passing but an approval is required before you can proceed with deployment

@JarLob
Copy link
Contributor

JarLob commented Oct 24, 2025

smoke test

@github-actions
Copy link

Deployment Triggered 🚀

JarLob, started a branch deployment to production (branch: namespace_aliases)

You can watch the progress here 🔗

Details
{
  "type": "branch",
  "environment": {
    "name": "production",
    "url": null
  },
  "deployment": {
    "timestamp": "2025-10-24T11:29:18.224Z",
    "logs": "https://github.com/GitHubSecurityLab/seclab-taskflow-agent/actions/runs/18778406045"
  },
  "git": {
    "branch": "namespace_aliases",
    "commit": "e1079c5669222579c0cdfa448f3af0a0482fa7dc",
    "verified": false,
    "committer": "m-y-mo",
    "html_url": "https://github.com/GitHubSecurityLab/seclab-taskflow-agent/commit/e1079c5669222579c0cdfa448f3af0a0482fa7dc"
  },
  "context": {
    "actor": "JarLob",
    "noop": false,
    "fork": false,
    "comment": {
      "created_at": "2025-10-24T11:28:56Z",
      "updated_at": "2025-10-24T11:28:56Z",
      "body": "smoke test",
      "html_url": "https://github.com/GitHubSecurityLab/seclab-taskflow-agent/pull/33#issuecomment-3442642757"
    }
  },
  "parameters": {
    "raw": null,
    "parsed": null
  }
}

@github-actions
Copy link

Deployment Results ❌

JarLob had a failure when deploying branch namespace_aliases to production

Details
{
  "status": "failure",
  "environment": {
    "name": "production",
    "url": null
  },
  "deployment": {
    "id": 3199897421,
    "timestamp": "2025-10-24T11:31:50.401Z",
    "logs": "https://github.com/GitHubSecurityLab/seclab-taskflow-agent/actions/runs/18778406045",
    "duration": 152
  },
  "git": {
    "branch": "namespace_aliases",
    "commit": "e1079c5669222579c0cdfa448f3af0a0482fa7dc",
    "verified": false
  },
  "context": {
    "actor": "JarLob",
    "noop": false,
    "fork": false
  },
  "reviews": {
    "count": 1,
    "decision": "APPROVED"
  },
  "parameters": {
    "raw": null,
    "parsed": null
  }
}

@JarLob
Copy link
Contributor

JarLob commented Oct 24, 2025

smoke test

@github-actions
Copy link

Deployment Triggered 🚀

JarLob, started a branch deployment to production (branch: namespace_aliases)

You can watch the progress here 🔗

Details
{
  "type": "branch",
  "environment": {
    "name": "production",
    "url": null
  },
  "deployment": {
    "timestamp": "2025-10-24T11:40:16.089Z",
    "logs": "https://github.com/GitHubSecurityLab/seclab-taskflow-agent/actions/runs/18778649917"
  },
  "git": {
    "branch": "namespace_aliases",
    "commit": "e1079c5669222579c0cdfa448f3af0a0482fa7dc",
    "verified": false,
    "committer": "m-y-mo",
    "html_url": "https://github.com/GitHubSecurityLab/seclab-taskflow-agent/commit/e1079c5669222579c0cdfa448f3af0a0482fa7dc"
  },
  "context": {
    "actor": "JarLob",
    "noop": false,
    "fork": false,
    "comment": {
      "created_at": "2025-10-24T11:39:57Z",
      "updated_at": "2025-10-24T11:39:57Z",
      "body": "smoke test",
      "html_url": "https://github.com/GitHubSecurityLab/seclab-taskflow-agent/pull/33#issuecomment-3442689529"
    }
  },
  "parameters": {
    "raw": null,
    "parsed": null
  }
}

@github-actions
Copy link

Deployment Results ❌

JarLob had a failure when deploying branch namespace_aliases to production

Details
{
  "status": "failure",
  "environment": {
    "name": "production",
    "url": null
  },
  "deployment": {
    "id": 3199946258,
    "timestamp": "2025-10-24T11:42:50.556Z",
    "logs": "https://github.com/GitHubSecurityLab/seclab-taskflow-agent/actions/runs/18778649917",
    "duration": 154
  },
  "git": {
    "branch": "namespace_aliases",
    "commit": "e1079c5669222579c0cdfa448f3af0a0482fa7dc",
    "verified": false
  },
  "context": {
    "actor": "JarLob",
    "noop": false,
    "fork": false
  },
  "reviews": {
    "count": 1,
    "decision": "APPROVED"
  },
  "parameters": {
    "raw": null,
    "parsed": null
  }
}

@JarLob
Copy link
Contributor

JarLob commented Oct 24, 2025

smoke test

@github-actions
Copy link

Deployment Triggered 🚀

JarLob, started a branch deployment to production (branch: namespace_aliases)

You can watch the progress here 🔗

Details
{
  "type": "branch",
  "environment": {
    "name": "production",
    "url": null
  },
  "deployment": {
    "timestamp": "2025-10-24T12:04:46.154Z",
    "logs": "https://github.com/GitHubSecurityLab/seclab-taskflow-agent/actions/runs/18779171202"
  },
  "git": {
    "branch": "namespace_aliases",
    "commit": "e1079c5669222579c0cdfa448f3af0a0482fa7dc",
    "verified": false,
    "committer": "m-y-mo",
    "html_url": "https://github.com/GitHubSecurityLab/seclab-taskflow-agent/commit/e1079c5669222579c0cdfa448f3af0a0482fa7dc"
  },
  "context": {
    "actor": "JarLob",
    "noop": false,
    "fork": false,
    "comment": {
      "created_at": "2025-10-24T12:04:22Z",
      "updated_at": "2025-10-24T12:04:22Z",
      "body": "smoke test",
      "html_url": "https://github.com/GitHubSecurityLab/seclab-taskflow-agent/pull/33#issuecomment-3442783467"
    }
  },
  "parameters": {
    "raw": null,
    "parsed": null
  }
}

@github-actions
Copy link

Deployment Results ❌

JarLob had a failure when deploying branch namespace_aliases to production

Details
{
  "status": "failure",
  "environment": {
    "name": "production",
    "url": null
  },
  "deployment": {
    "id": 3200056043,
    "timestamp": "2025-10-24T12:08:21.610Z",
    "logs": "https://github.com/GitHubSecurityLab/seclab-taskflow-agent/actions/runs/18779171202",
    "duration": 215
  },
  "git": {
    "branch": "namespace_aliases",
    "commit": "e1079c5669222579c0cdfa448f3af0a0482fa7dc",
    "verified": false
  },
  "context": {
    "actor": "JarLob",
    "noop": false,
    "fork": false
  },
  "reviews": {
    "count": 1,
    "decision": "APPROVED"
  },
  "parameters": {
    "raw": null,
    "parsed": null
  }
}

@JarLob
Copy link
Contributor

JarLob commented Oct 24, 2025

smoke test

@github-actions
Copy link

Deployment Triggered 🚀

JarLob, started a branch deployment to production (branch: namespace_aliases)

You can watch the progress here 🔗

Details
{
  "type": "branch",
  "environment": {
    "name": "production",
    "url": null
  },
  "deployment": {
    "timestamp": "2025-10-24T12:09:11.298Z",
    "logs": "https://github.com/GitHubSecurityLab/seclab-taskflow-agent/actions/runs/18779274902"
  },
  "git": {
    "branch": "namespace_aliases",
    "commit": "e1079c5669222579c0cdfa448f3af0a0482fa7dc",
    "verified": false,
    "committer": "m-y-mo",
    "html_url": "https://github.com/GitHubSecurityLab/seclab-taskflow-agent/commit/e1079c5669222579c0cdfa448f3af0a0482fa7dc"
  },
  "context": {
    "actor": "JarLob",
    "noop": false,
    "fork": false,
    "comment": {
      "created_at": "2025-10-24T12:08:42Z",
      "updated_at": "2025-10-24T12:08:42Z",
      "body": "smoke test",
      "html_url": "https://github.com/GitHubSecurityLab/seclab-taskflow-agent/pull/33#issuecomment-3442799074"
    }
  },
  "parameters": {
    "raw": null,
    "parsed": null
  }
}

@github-actions
Copy link

Deployment Results ❌

JarLob had a failure when deploying branch namespace_aliases to production

Details
{
  "status": "failure",
  "environment": {
    "name": "production",
    "url": null
  },
  "deployment": {
    "id": 3200078812,
    "timestamp": "2025-10-24T12:11:31.384Z",
    "logs": "https://github.com/GitHubSecurityLab/seclab-taskflow-agent/actions/runs/18779274902",
    "duration": 140
  },
  "git": {
    "branch": "namespace_aliases",
    "commit": "e1079c5669222579c0cdfa448f3af0a0482fa7dc",
    "verified": false
  },
  "context": {
    "actor": "JarLob",
    "noop": false,
    "fork": false
  },
  "reviews": {
    "count": 1,
    "decision": "APPROVED"
  },
  "parameters": {
    "raw": null,
    "parsed": null
  }
}

@JarLob JarLob self-requested a review October 24, 2025 12:12
@m-y-mo
Copy link
Contributor Author

m-y-mo commented Oct 24, 2025

smoke test

@github-actions
Copy link

Deployment Triggered 🚀

m-y-mo, started a branch deployment to production (branch: namespace_aliases)

You can watch the progress here 🔗

Details
{
  "type": "branch",
  "environment": {
    "name": "production",
    "url": null
  },
  "deployment": {
    "timestamp": "2025-10-24T16:12:58.440Z",
    "logs": "https://github.com/GitHubSecurityLab/seclab-taskflow-agent/actions/runs/18785529467"
  },
  "git": {
    "branch": "namespace_aliases",
    "commit": "883f42ab763658c8195985c50595b59e3207e57d",
    "verified": true,
    "committer": "web-flow",
    "html_url": "https://github.com/GitHubSecurityLab/seclab-taskflow-agent/commit/883f42ab763658c8195985c50595b59e3207e57d"
  },
  "context": {
    "actor": "m-y-mo",
    "noop": false,
    "fork": false,
    "comment": {
      "created_at": "2025-10-24T16:12:34Z",
      "updated_at": "2025-10-24T16:12:34Z",
      "body": "smoke test",
      "html_url": "https://github.com/GitHubSecurityLab/seclab-taskflow-agent/pull/33#issuecomment-3443928690"
    }
  },
  "parameters": {
    "raw": null,
    "parsed": null
  }
}

@github-actions
Copy link

Deployment Results ❌

m-y-mo had a failure when deploying branch namespace_aliases to production

Details
{
  "status": "failure",
  "environment": {
    "name": "production",
    "url": null
  },
  "deployment": {
    "id": 3201372159,
    "timestamp": "2025-10-24T16:15:12.499Z",
    "logs": "https://github.com/GitHubSecurityLab/seclab-taskflow-agent/actions/runs/18785529467",
    "duration": 134
  },
  "git": {
    "branch": "namespace_aliases",
    "commit": "883f42ab763658c8195985c50595b59e3207e57d",
    "verified": true
  },
  "context": {
    "actor": "m-y-mo",
    "noop": false,
    "fork": false
  },
  "reviews": {
    "count": 1,
    "decision": "APPROVED"
  },
  "parameters": {
    "raw": null,
    "parsed": null
  }
}

@m-y-mo
Copy link
Contributor Author

m-y-mo commented Oct 27, 2025

smoke test

@github-actions
Copy link

Deployment Triggered 🚀

m-y-mo, started a branch deployment to production (branch: namespace_aliases)

You can watch the progress here 🔗

Details
{
  "type": "branch",
  "environment": {
    "name": "production",
    "url": null
  },
  "deployment": {
    "timestamp": "2025-10-27T10:28:01.993Z",
    "logs": "https://github.com/GitHubSecurityLab/seclab-taskflow-agent/actions/runs/18837764207"
  },
  "git": {
    "branch": "namespace_aliases",
    "commit": "883f42ab763658c8195985c50595b59e3207e57d",
    "verified": true,
    "committer": "web-flow",
    "html_url": "https://github.com/GitHubSecurityLab/seclab-taskflow-agent/commit/883f42ab763658c8195985c50595b59e3207e57d"
  },
  "context": {
    "actor": "m-y-mo",
    "noop": false,
    "fork": false,
    "comment": {
      "created_at": "2025-10-27T10:27:44Z",
      "updated_at": "2025-10-27T10:27:44Z",
      "body": "smoke test",
      "html_url": "https://github.com/GitHubSecurityLab/seclab-taskflow-agent/pull/33#issuecomment-3450559961"
    }
  },
  "parameters": {
    "raw": null,
    "parsed": null
  }
}

@github-actions
Copy link

Deployment Results ✅

m-y-mo successfully deployed branch namespace_aliases to production

Details
{
  "status": "success",
  "environment": {
    "name": "production",
    "url": null
  },
  "deployment": {
    "id": 3210322075,
    "timestamp": "2025-10-27T10:33:02.262Z",
    "logs": "https://github.com/GitHubSecurityLab/seclab-taskflow-agent/actions/runs/18837764207",
    "duration": 300
  },
  "git": {
    "branch": "namespace_aliases",
    "commit": "883f42ab763658c8195985c50595b59e3207e57d",
    "verified": true
  },
  "context": {
    "actor": "m-y-mo",
    "noop": false,
    "fork": false
  },
  "reviews": {
    "count": 1,
    "decision": "APPROVED"
  },
  "parameters": {
    "raw": null,
    "parsed": null
  }
}

@m-y-mo
Copy link
Contributor Author

m-y-mo commented Oct 27, 2025

close in favour of this: #37

@m-y-mo m-y-mo closed this Oct 27, 2025
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.

4 participants