Commit 21d34d7
fix: session-scoped reflection toggle — no cross-instance contamination
Previous .reflection/disabled was a global file shared across all
instances in the same directory, so disabling one session silently
disabled all of them.
New approach: .reflection/disabled is a newline list of session IDs.
Each instance only skips its own session ID — two CC/OC processes in
the same dir are unaffected by each other's toggle.
OpenCode:
- isSessionDisabled(sessionId) / setSessionDisabled(sessionId, bool)
read+write the session-ID list
- reflection tool now uses currentSessionId (updated on each
session.idle) so it always targets the active session
Claude Code:
- reflect.mjs writes .reflection/current_session on every fire
so agents can reference their own session ID without knowing it
- disabled check reads the list and matches session_id from payload
- To disable: echo "SESSION_ID" >> .reflection/disabled
(or: echo $(cat .reflection/current_session) >> .reflection/disabled)
- To enable: grep -v SESSION_ID .reflection/disabled > .tmp && mv .tmp .reflection/disabled
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>1 parent 1882ca2 commit 21d34d7
2 files changed
Lines changed: 58 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
447 | 447 | | |
448 | 448 | | |
449 | 449 | | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | | - | |
455 | | - | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
456 | 470 | | |
457 | 471 | | |
458 | 472 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1565 | 1565 | | |
1566 | 1566 | | |
1567 | 1567 | | |
| 1568 | + | |
| 1569 | + | |
| 1570 | + | |
| 1571 | + | |
| 1572 | + | |
| 1573 | + | |
| 1574 | + | |
| 1575 | + | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
1568 | 1593 | | |
1569 | 1594 | | |
1570 | 1595 | | |
| |||
1585 | 1610 | | |
1586 | 1611 | | |
1587 | 1612 | | |
1588 | | - | |
1589 | | - | |
| 1613 | + | |
| 1614 | + | |
1590 | 1615 | | |
1591 | | - | |
1592 | | - | |
1593 | | - | |
1594 | | - | |
1595 | | - | |
1596 | | - | |
1597 | | - | |
1598 | | - | |
1599 | | - | |
1600 | | - | |
1601 | | - | |
1602 | | - | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
1603 | 1622 | | |
1604 | 1623 | | |
1605 | 1624 | | |
| |||
1649 | 1668 | | |
1650 | 1669 | | |
1651 | 1670 | | |
1652 | | - | |
1653 | | - | |
| 1671 | + | |
| 1672 | + | |
| 1673 | + | |
| 1674 | + | |
| 1675 | + | |
1654 | 1676 | | |
1655 | 1677 | | |
1656 | 1678 | | |
| |||
0 commit comments