Skip to content

fix: activate agentos from link names#1

Open
ch0udry wants to merge 1 commit into
mainfrom
fix/agentos-link-activation
Open

fix: activate agentos from link names#1
ch0udry wants to merge 1 commit into
mainfrom
fix/agentos-link-activation

Conversation

@ch0udry

@ch0udry ch0udry commented Jun 18, 2026

Copy link
Copy Markdown
Owner

Summary

pi-link <agent> now reliably becomes that AgentOS role when the project registry declares it, while undeclared link names remain plain pi-link sessions. The fix also documents the intended fresh/resume flows and adds /agentos-status so users can confirm whether the current session is role-backed, fallback-only, or failing to load.

The important behavior is now:

User command Result
pi-link planner resume/create the planner linked session and activate Planner Agent when declared
pi --link --link-name planner start a fresh persistent Planner Agent session
pi --link --link-name planner --no-session start a fresh non-persistent Planner Agent scratch session
/agentos-status report active role, plain fallback, or load error

Design notes

  • AgentOS name resolution now checks the Pi --link-name flag, PI_LINK_NAME, pi-link saved link-name entries, and finally the Pi session name.
  • Activation refreshes again before the model turn, so pi-link extension ordering cannot silently leave a declared agent as a plain session.
  • Tool policies are still restored when an AgentOS role clears, but plain undeclared pi-link sessions do not trigger noisy errors.

Verification

  • npm test — 17 passing
  • npm pack --dry-run
  • node -e "import('./index.ts').then(() => console.log('index import ok'))"
  • git diff --check
  • smoke: temp install + pi --link --link-name planner replied as Planner role
  • smoke: temp install + pi --link --link-name scratch stayed plain Pi
  • reviewer agent: no blockers

Compound Engineering
Pi

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

Copy link
Copy Markdown

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: 40a5e2353c

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

Comment thread README.md
Comment on lines +109 to +113
Open a fresh persistent Planner Agent session:

```sh
pi --link --link-name planner
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Stop calling --link-name a fresh-session command

For users who already have a Pi session in this cwd, pi --link --link-name planner does not force a new session; pi-link documents --link-name as link identity only and leaves Pi's normal session selection untouched (latest session in cwd, or fresh only when there is none). This example can make users attach the Planner Agent role to an existing conversation when they expected a clean persistent session, so the README should either describe the normal Pi selection behavior or include the actual fresh-session mechanism.

Useful? React with 👍 / 👎.

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.

1 participant