Commit 118e79b
committed
feat: teammate delegated sessions - start sessions on behalf of owner
Allow teammates to start OpenCode sessions on behalf of the session
owner by @mentioning both the bot and the owner in a channel thread.
Example: '@kaji @christine fix this bug' creates a session owned by
@christine with the sender auto-approved.
Key behaviors:
- Non-owner mentions only @kaji → silently ignored (no session creation)
- Non-owner mentions @kaji + @owner in channel owner isn't in → ignored
- Non-owner mentions @kaji + @owner in shared channel → delegated session
- Initiating teammate is auto-approved for the session
- Session announcement shows 'Started by' field
- Team members can approve guest access requests in the thread
Changes:
- session-ownership-handler.ts: add detectMentionedUsers(), DelegatedSessionRequest
- connect.ts: delegation detection, channel membership check, owner-only solo creation
- index.ts: createNewSessionFromDm supports delegation flags
- thread-manager.ts: delegatedByUsername in thread announcements
- models/index.ts: delegatedByUsername on ThreadRootPostContent
- Bump version to 0.3.941 parent d98f9db commit 118e79b
File tree
6 files changed
+166
-17
lines changed- .opencode/plugin/mattermost-control
- tools
- src
- models
6 files changed
+166
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
566 | 566 | | |
567 | 567 | | |
568 | 568 | | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
569 | 580 | | |
570 | 581 | | |
571 | 582 | | |
| |||
576 | 587 | | |
577 | 588 | | |
578 | 589 | | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
579 | 594 | | |
580 | 595 | | |
581 | 596 | | |
582 | 597 | | |
583 | 598 | | |
584 | | - | |
| 599 | + | |
585 | 600 | | |
586 | 601 | | |
587 | 602 | | |
588 | 603 | | |
589 | 604 | | |
590 | | - | |
| 605 | + | |
591 | 606 | | |
592 | 607 | | |
593 | | - | |
| 608 | + | |
594 | 609 | | |
595 | 610 | | |
596 | 611 | | |
597 | | - | |
| 612 | + | |
| 613 | + | |
598 | 614 | | |
599 | 615 | | |
600 | 616 | | |
601 | | - | |
| 617 | + | |
602 | 618 | | |
603 | 619 | | |
| 620 | + | |
604 | 621 | | |
605 | 622 | | |
606 | 623 | | |
607 | 624 | | |
608 | 625 | | |
609 | 626 | | |
610 | 627 | | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
611 | 640 | | |
612 | 641 | | |
613 | 642 | | |
614 | 643 | | |
615 | 644 | | |
616 | 645 | | |
617 | | - | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
618 | 651 | | |
619 | 652 | | |
620 | 653 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
502 | 502 | | |
503 | 503 | | |
504 | 504 | | |
505 | | - | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
506 | 512 | | |
507 | | - | |
508 | | - | |
509 | | - | |
510 | | - | |
| 513 | + | |
511 | 514 | | |
512 | 515 | | |
513 | 516 | | |
| |||
524 | 527 | | |
525 | 528 | | |
526 | 529 | | |
527 | | - | |
528 | | - | |
529 | | - | |
530 | | - | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
531 | 596 | | |
532 | 597 | | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
533 | 602 | | |
534 | 603 | | |
535 | 604 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
| 197 | + | |
| 198 | + | |
197 | 199 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
25 | 36 | | |
26 | 37 | | |
27 | 38 | | |
| |||
291 | 302 | | |
292 | 303 | | |
293 | 304 | | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
294 | 330 | | |
295 | 331 | | |
296 | 332 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| 41 | + | |
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
| |||
197 | 199 | | |
198 | 200 | | |
199 | 201 | | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
200 | 209 | | |
201 | 210 | | |
202 | 211 | | |
| |||
0 commit comments