Skip to content
This repository was archived by the owner on Oct 23, 2023. It is now read-only.

context name in agent.context object always '-' when used with environmentsΒ #187

@woeckener

Description

@woeckener

Hey!

I came across this bug as I managed my agent with environments.
Upon building the contexts in the v2-agents context object the name is set as the substring after the sixth slash.

src/context.js

_processV2InputContexts(v2InputContexts) {
  let contexts = {};
  for (let index = 0; index<v2InputContexts.length; index++) {
    let context = v2InputContexts[index];
    const name = context['name'].split('/')[6];
    contexts[name] = {
      name: name,
      lifespan: context['lifespanCount'],
      parameters: context['parameters']};
    }
  return contexts;
}

In cases where the v2InputContexts name includes an environment, the name is build like this:
projects/projectname/agent/environments/environmentname/users/-/sessions/123456/contextname
and the name always turns out to be '-', as that is now the substring after the sixth slash x)

The issue is that none of the actual contexts are stored in agent.context when requesting a specific environment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions