Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
637d634
Report failed attachment uploads from the CLI
harshsaver Nov 27, 2026
b9c70b9
Fix the README link to connection options
harshsaver Nov 27, 2026
ee9190e
Refuse runtime discovery files another local user could plant
harshsaver Nov 27, 2026
feb9495
Recover OAuth client capacity from abandoned registrations
harshsaver Nov 27, 2026
77e4733
Include the issuer in OAuth authorization responses
harshsaver Nov 27, 2026
3455013
Let workspace admins revoke only member invitations
harshsaver Nov 27, 2026
9166165
Update the Desktop integration guide to current binary and artifact n…
harshsaver Nov 27, 2026
07c9e46
Keep shared sign-in checks alive when one caller cancels
harshsaver Nov 27, 2026
3e5f887
Mark commands and APIs added after the 0.2.0 candidate
harshsaver Nov 27, 2026
1d7c827
Show the daemon and workspace setup before the CLI messaging example
harshsaver Nov 27, 2026
56273af
Describe the Claude plugin marketplace
harshsaver Nov 27, 2026
7ec9acf
Return NOT_FOUND when completing or releasing an unknown task
harshsaver Nov 27, 2026
4df3965
Accept escalation answers when the message backlog is full
harshsaver Nov 27, 2026
42cc846
Expire messages before releasing an expired inbox reservation
harshsaver Nov 27, 2026
634d22d
Pass the managed command's exit status through agent run
harshsaver Nov 27, 2026
2ed1023
Name the accepted local address form when refusing a plain HTTP Bus a…
harshsaver Nov 27, 2026
be05196
Correct the message_receipt authorization in the MCP specification
harshsaver Nov 27, 2026
54e5f02
Add a bug report form and point vulnerability reports to private repo…
harshsaver Nov 27, 2026
ebca94a
Describe the hosted service in the security policy scope
harshsaver Nov 27, 2026
2ed4bf0
Keep native exit status and Windows interrupts intact in the npm laun…
harshsaver Nov 27, 2026
89f6255
Release the inbox reservation when a pull's commit fails
harshsaver Nov 27, 2026
eb2485b
Describe Desktop and hosted integrations in public terms
harshsaver Nov 27, 2026
0b75dd0
Revoke tokens issued from a replayed OAuth authorization code
harshsaver Nov 27, 2026
99d7175
Distinguish network, timeout and abort failures in the TypeScript client
harshsaver Nov 27, 2026
49a4f19
Add optional per-client limits to hosted OAuth and device pairing
harshsaver Nov 27, 2026
643f508
Name the executable consistently in the hosted deployment guides
harshsaver Nov 27, 2026
c9669ad
Reject oversized TypeScript attachment uploads through the returned p…
harshsaver Nov 27, 2026
7eaa418
Use a descriptive name for the remote connection contract
harshsaver Nov 27, 2026
f0ccbf8
Keep one workspace's file activity from stalling others
harshsaver Nov 27, 2026
cf80eda
Stop members from restoring connections an admin revoked
harshsaver Nov 27, 2026
af89cad
Skip workspaces deleted during hosted retention maintenance
harshsaver Nov 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "october",
"owner": { "name": "October" },
"metadata": { "description": "Agent Intercom plugins for connecting Claude Code sessions to other agents." },
"plugins": [{ "name": "agent-intercom", "source": "./plugin", "description": "Messages, shared work and native inbox notifications for connected agents." }]
}
43 changes: 43 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Bug report
description: Report incorrect behavior in the agentintercom CLI, daemon, SDKs or workspace UI.
labels: [bug]
body:
- type: markdown
attributes:
value: |
Report security vulnerabilities privately through the security policy, not here.
Never post tokens, connection files, private messages or account links.
- type: textarea
id: what-happened
attributes:
label: What happened
description: What you did, what you expected, and what happened instead.
validations:
required: true
- type: textarea
id: reproduce
attributes:
label: Steps to reproduce
description: Commands or steps, with credentials replaced by placeholders.
validations:
required: true
- type: input
id: version
attributes:
label: Version
description: Output of `agentintercom version`, or the commit you built from.
validations:
required: true
- type: input
id: platform
attributes:
label: Platform
description: Operating system and architecture, plus the agent app and its version if one is involved.
validations:
required: true
- type: textarea
id: logs
attributes:
label: Relevant output
description: Error messages or `agentintercom doctor --json` output, with secrets removed.
render: text
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: Report a security vulnerability
url: https://github.com/october-dev/agentintercom/security/advisories/new
about: Report vulnerabilities privately instead of opening a public issue.
46 changes: 45 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,50 @@

## Unreleased

Changes on `main` after the `0.2.0` release candidate. They are not in the
published `agentintercom-cli@0.2.0` package; build from source to use them
before the next release.

- Add `task claim`, `task release`, `task complete` and `task progress` CLI
commands for shared tasks (#196).
- Add `question list` and `question answer` to answer pending agent questions
from a terminal (#195).
- Let `agent run` read the scope token from `--scope-token-file` or
`--scope-token-fd` (#155).
- Add `downloadAttachment` to the TypeScript client, with integrity checks (#197).
- Run the Cursor adapter under `agent run` and let `doctor` find `cursor-agent`
(#209).
- Exit with status 0 for subcommand `--help` (#191).
- Preserve the HTTP status when a Go client error body is not valid JSON (#190).
- Report failed `attachment upload` requests instead of printing `null`.
- Exit `agent run` and `session start` with the managed command's exit status,
and with a failure status after an interrupt.
- TypeScript client: report requests that fail without a runtime response as
`BusNetworkError`, `BusTimeoutError` or `BusAbortError` (subclasses of the new
`BusTransportError`, which keeps the `INTERNAL` code for compatibility) with
the underlying `cause`.
- Go and TypeScript clients: release an inbox reservation when its commit fails
or is cancelled, so messages return to the inbox without waiting 30 seconds.
- npm launcher: let Windows Ctrl+C reach the native process instead of
terminating it, and report signal exits (including SIGPIPE) as `128 + signal`.
- Return `NOT_FOUND` when completing or releasing an unknown task, accept
escalation answers when the message backlog is full, and expire messages
before releasing an expired inbox reservation.
- Refuse a runtime directory or discovery file owned by another local user.
- Hosted: recover OAuth client registration capacity from abandoned clients,
send the RFC 9207 `iss` authorization response parameter, and limit admins
to revoking member invitations.
- Hosted: optional per-client rate limits for OAuth registration and
authorization and device pairing, keyed on a proxy forwarding header
(`hosted serve --client-ip-header`, `--trusted-proxy`).
- Hosted: a member can no longer restore a connection that a workspace owner or
admin revoked by replacing it (migration `015_connection_revoker.sql`), and
one workspace's file deletion no longer stalls file access in others.
- Hosted: replaying a redeemed OAuth authorization code with its PKCE verifier
revokes the tokens issued from that code.

## 0.2.0 (release candidate)

- Use the Agent Intercom product name, `agentintercom` command and
`agentintercom-cli` npm package.
Move the repository and Go module to `october-dev/agentintercom`. The
Expand All @@ -14,6 +58,6 @@
- Preserve existing protocol 0.1 health/archive identifiers, local data paths,
`OCTOBER_BUS_*` configuration, applied migrations and hosted deployment paths.

These changes are not a claim that an npm release or hosted launch has occurred.
`0.2.0` is published to npm under the `candidate` tag; it is not a hosted launch.
See [releases](https://github.com/october-dev/agentintercom/releases) for published
versions and [compatibility](compatibility/registry.json) for qualified adapters.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ npx agentintercom-cli@0.2.0 demo

**Release note:** Version `0.2.0` is currently a release candidate. Use the version shown above when installing, since npm's `latest` tag still points to a placeholder.

On Windows or using a different agent? Check out the [connection options](https://github.com/october-dev/agentintercom#ways-to-connect).
On Windows or using a different agent? Check out the [connection options](https://github.com/october-dev/agentintercom/blob/main/docs/connect-sessions.md).

Need help? See the [installation guide](https://github.com/october-dev/agentintercom/blob/main/docs/installation.md).

Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ Security reports may cover:
- malicious protocol inputs or denial of service;
- adapter behavior that bypasses a harness permission boundary.

The current reference runtime is local-first and binds to loopback. Remote deployments need a separate authenticated transport and threat review.
The local runtime binds to loopback. Self-hosted workspaces use the authenticated HTTPS service described in [hosted workspaces](docs/hosted-workspaces.md) and [production hardening](docs/production-hardening.md); reports about that service, its OAuth and account flows, and the browser workspace are in scope.

See [the local threat model](docs/threat-model.md) for current assumptions and limits.
2 changes: 1 addition & 1 deletion adapters/cursor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Doctor probes a separate temporary bridge. Its `hostExecutable` identifies which
| Discover and notify | Ask Cursor to call `list_peers` and send `codex-builder` a short `message_peer` with mode `notify`. Ask Codex to call `check_inbox`, then `acknowledge_messages` with the processed IDs. |
| Request and reply | Ask Codex to send Cursor a `request` with a fresh `idempotencyKey` and one short `text` context item. Ask Cursor to pull, acknowledge, and send a `response` with `responseTo` set to the request ID. Codex can pull and acknowledge the reply, then check the original ID with `message_receipt`. Its `responseMessageId` should match the reply. |
| Share a task | Ask Cursor to call `add_task`, then ask Codex to find the task with `list_tasks`, claim it, and complete it. Cursor can check the final state. |
| Ask a human | Ask Cursor to call `ask_user` with a short question. In the operator terminal, run `agentintercom question list --workspace cursor-demo`, then `agentintercom question answer --workspace cursor-demo --id QUESTION_ID --answer yes` with the returned ID. Have Cursor pull and acknowledge the answer. |
| Ask a human | Ask Cursor to call `ask_user` with a short question. In the operator terminal, run `agentintercom question list --workspace cursor-demo` (newer than `0.2.0`; use a source build), then `agentintercom question answer --workspace cursor-demo --id QUESTION_ID --answer yes` with the returned ID. Have Cursor pull and acknowledge the answer. |

Use `check_inbox` between work steps. For a short check use `waitMs=1000`. Queued work waits until the host pulls. Send only the context the peer needs. An incoming request still goes through the recipient's normal permission controls.

Expand Down
2 changes: 1 addition & 1 deletion bus/archive.go
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ func validateArchive(archive *ScopeArchive) error {
}
}
}
if activeMessages > messageBacklogCap {
if activeMessages > maxActiveMessages {
return Errorf(CodeInvalidArgument, "Archive message backlog exceeds the scope limit")
}
for _, message := range archive.Messages {
Expand Down
47 changes: 36 additions & 11 deletions bus/attachments.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"strconv"
"strings"
"sync"
"sync/atomic"
"time"
"unicode"

Expand Down Expand Up @@ -71,6 +72,7 @@ type attachmentFiles struct {
mu sync.Mutex
directory string
root *os.Root
readRoot atomic.Pointer[os.Root]
lock *os.File
temporary bool
}
Expand Down Expand Up @@ -142,11 +144,30 @@ func (f *attachmentFiles) open(source string) error {
return err
}
f.root, f.lock = root, lock
f.readRoot.Store(root)
return nil
}

// readable opens the directory if needed and returns its root for reading.
// Reads do not hold f.mu, so one workspace's large reads or exports never
// serialize another's; callers hold maintenance.RLock, which close waits for.
func (f *attachmentFiles) readable(source string) (*os.Root, error) {
if root := f.readRoot.Load(); root != nil {
return root, nil
}
f.mu.Lock()
defer f.mu.Unlock()
if err := f.open(source); err != nil {
return nil, err
}
return f.root, nil
}
func (f *attachmentFiles) close() {
f.maintenance.Lock()
defer f.maintenance.Unlock()
f.mu.Lock()
defer f.mu.Unlock()
f.readRoot.Store(nil)
if f.root != nil {
_ = f.root.Close()
}
Expand Down Expand Up @@ -476,12 +497,11 @@ func (s *Store) ReadAttachment(ctx context.Context, scopeID, id string, offset i
if err := consumeAttachmentTransfer(ctx, tx, scopeID, size, false); err != nil {
return result, err
}
s.files.mu.Lock()
defer s.files.mu.Unlock()
if err := s.files.open(s.source); err != nil {
root, err := s.files.readable(s.source)
if err != nil {
return result, err
}
data, err := s.readAttachmentFile(a, offset, size)
data, err := readAttachmentFile(root, a, offset, size)
if err != nil {
return result, err
}
Expand All @@ -491,12 +511,12 @@ func (s *Store) ReadAttachment(ctx context.Context, scopeID, id string, offset i
}
return result, tx.Commit()
}
func (s *Store) readAttachmentFile(a Attachment, offset, size int64) ([]byte, error) {
info, err := s.files.root.Lstat(a.ID)
func readAttachmentFile(root *os.Root, a Attachment, offset, size int64) ([]byte, error) {
info, err := root.Lstat(a.ID)
if err != nil || !info.Mode().IsRegular() || info.Size() != a.Size || (runtime.GOOS != "windows" && info.Mode().Perm()&0077 != 0) {
return nil, Errorf(CodeInternal, "Attachment file is unavailable; restore it from backup")
}
file, err := s.files.root.Open(a.ID)
file, err := root.Open(a.ID)
if err != nil {
return nil, Errorf(CodeInternal, "Attachment file is unavailable")
}
Expand All @@ -518,8 +538,6 @@ func (s *Store) readAttachmentFile(a Attachment, offset, size int64) ([]byte, er
return data, nil
}
func (s *Store) DeleteAttachment(ctx context.Context, scopeID, id string) error {
s.files.maintenance.Lock()
defer s.files.maintenance.Unlock()
kind, actor, err := channelAuthor(ctx, scopeID)
if err != nil {
return err
Expand Down Expand Up @@ -557,8 +575,15 @@ func (s *Store) DeleteAttachment(ctx context.Context, scopeID, id string) error
if err := tx.Commit(); err != nil {
return err
}
// The exclusive maintenance lock lets an in-progress backup finish first.
// If unlinking fails, metadata still blocks reads and maintenance retries it.
// The committed tombstone already hides the file. Unlink it now only if no
// read, export or backup that may have seen the old metadata is running;
// waiting for them would let one workspace's long export stall every
// workspace's file access behind this deletion. Otherwise, or if unlinking
// fails, garbage collection removes the file later.
if !s.files.maintenance.TryLock() {
return nil
}
defer s.files.maintenance.Unlock()
s.files.mu.Lock()
defer s.files.mu.Unlock()
if err := s.files.open(s.source); err == nil {
Expand Down
9 changes: 4 additions & 5 deletions bus/attachments_archive.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,13 @@ func (s *Store) exportAttachments(ctx context.Context, tx sqlExecutor, scopeID s
if len(archive.Attachments) == 0 {
return nil
}
s.files.mu.Lock()
defer s.files.mu.Unlock()
if err := s.files.open(s.source); err != nil {
root, err := s.files.readable(s.source)
if err != nil {
return err
}
for i := range archive.Attachments {
a := &archive.Attachments[i]
data, err := s.readAttachmentFile(a.Attachment, 0, a.Size)
data, err := readAttachmentFile(root, a.Attachment, 0, a.Size)
if err != nil {
return err
}
Expand Down Expand Up @@ -132,7 +131,7 @@ func (s *Store) importAttachments(ctx context.Context, tx sqlExecutor, archive S
}
// A retry after a rolled-back import may find the already durable bytes.
if _, err := s.files.root.Lstat(a.ID); err == nil {
if _, err := s.readAttachmentFile(a.Attachment, 0, a.Size); err != nil {
if _, err := readAttachmentFile(s.files.root, a.Attachment, 0, a.Size); err != nil {
return err
}
} else if !os.IsNotExist(err) {
Expand Down
85 changes: 85 additions & 0 deletions bus/attachments_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,3 +367,88 @@ func TestAttachmentBackupLockPreservesBytesAndAllowsCoordination(t *testing.T) {
_, err = a.runtime.UploadAttachment(ctx, a.plannerToken, UploadAttachmentInput{Name: "resumed"}, []byte("new bytes"))
requireNoError(t, err)
}

// One workspace's long export or file read must not stall another workspace's
// file access, even while the first deletes a file.
func TestAttachmentDeletionDoesNotStallOtherWorkspaces(t *testing.T) {
a := setupAgents(t, ":memory:")
defer a.runtime.Close()
ctx := context.Background()
store := a.runtime.store.(*Store)
mine, err := a.runtime.UploadAttachment(ctx, a.plannerToken, UploadAttachmentInput{Name: "mine"}, []byte("tenant a"))
requireNoError(t, err)
other, err := a.runtime.CreateScope(ctx, CreateScopeInput{})
requireNoError(t, err)
agent, err := a.runtime.RegisterAgent(ctx, other.ScopeToken, RegisterAgentInput{ID: "neighbour", DisplayName: "Neighbour"})
requireNoError(t, err)
theirs, err := a.runtime.UploadAttachment(ctx, agent.AgentToken, UploadAttachmentInput{Name: "theirs"}, []byte("tenant b"))
requireNoError(t, err)

within := func(name string, work func() error) {
t.Helper()
done := make(chan error, 1)
go func() { done <- work() }()
select {
case err := <-done:
requireNoError(t, err)
case <-time.After(5 * time.Second):
t.Fatalf("%s was blocked by another workspace", name)
}
}
// Workspace A's export is in progress (exports hold this shared lock).
store.files.maintenance.RLock()
var release sync.Once
defer release.Do(store.files.maintenance.RUnlock)
within("deletion during an export", func() error { return a.runtime.DeleteAttachment(ctx, a.plannerToken, mine.ID) })
within("another workspace's read", func() error {
content, err := a.runtime.ReadAttachment(ctx, agent.AgentToken, theirs.ID, 0, 100)
if err == nil && string(content.Data) != "tenant b" {
t.Errorf("read returned %q", content.Data)
}
return err
})
within("another workspace's upload", func() error {
_, err := a.runtime.UploadAttachment(ctx, agent.AgentToken, UploadAttachmentInput{Name: "more"}, []byte("more"))
return err
})
// Export requires no active executions; pause the neighbour's briefly.
var lifecycle string
requireNoError(t, store.db.QueryRowContext(ctx, "SELECT lifecycle FROM agents WHERE scope_id=?", other.ScopeID).Scan(&lifecycle))
_, err = store.db.ExecContext(ctx, "UPDATE agents SET lifecycle='offline' WHERE scope_id=?", other.ScopeID)
requireNoError(t, err)
within("another workspace's export", func() error {
archive, err := a.runtime.ExportScope(ctx, other.ScopeID)
if err == nil && len(archive.Attachments) != 2 {
t.Errorf("export contained %d attachments", len(archive.Attachments))
}
return err
})
_, err = store.db.ExecContext(ctx, "UPDATE agents SET lifecycle=? WHERE scope_id=?", lifecycle, other.ScopeID)
requireNoError(t, err)
// The export may still read the deleted file's bytes, so they stay until
// garbage collection runs with no reader present.
_, err = os.Stat(filepath.Join(store.files.directory, mine.ID))
requireNoError(t, err)
_, err = a.runtime.ReadAttachment(ctx, a.plannerToken, mine.ID, 0, 100)
requireCode(t, err, CodeNotFound)
release.Do(store.files.maintenance.RUnlock)
_, err = store.CollectAttachmentGarbage(ctx)
requireNoError(t, err)
_, err = os.Stat(filepath.Join(store.files.directory, mine.ID))
require(t, os.IsNotExist(err), "deferred deletion was not collected")

// A slow write elsewhere (holding the file mutex) does not block reads.
store.files.mu.Lock()
var unlock sync.Once
defer unlock.Do(store.files.mu.Unlock)
within("a read during another write", func() error {
_, err := a.runtime.ReadAttachment(ctx, agent.AgentToken, theirs.ID, 0, 100)
return err
})
unlock.Do(store.files.mu.Unlock)

// With no reader present, deletion unlinks the file immediately.
requireNoError(t, a.runtime.DeleteAttachment(ctx, agent.AgentToken, theirs.ID))
_, err = os.Stat(filepath.Join(store.files.directory, theirs.ID))
require(t, os.IsNotExist(err), "idle deletion did not unlink the file")
}
2 changes: 1 addition & 1 deletion bus/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func (s *Store) BackupBundle(ctx context.Context, output io.Writer) error {
if err := s.files.open(s.source); err != nil {
return err
}
data, err := s.readAttachmentFile(a, 0, a.Size)
data, err := readAttachmentFile(s.files.root, a, 0, a.Size)
if err != nil {
return err
}
Expand Down
11 changes: 10 additions & 1 deletion bus/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,16 @@ func (c Client) PullInbox(ctx context.Context, limit int, wait time.Duration) ([
if err != nil || reservation == nil {
return nil, err
}
return c.CommitInbox(ctx, reservation.ID)
messages, err := c.CommitInbox(ctx, reservation.ID)
if err != nil {
// Return the messages to the inbox now rather than after the
// reservation expires. This is best effort and ignores the caller's
// cancellation; a reservation that did commit is unaffected.
release, cancel := context.WithTimeout(context.WithoutCancel(ctx), 5*time.Second)
_ = c.ReleaseInbox(release, reservation.ID)
cancel()
}
return messages, err
}

func (c Client) AcknowledgeMessages(ctx context.Context, messageIDs []string) (int64, error) {
Expand Down
Loading
Loading