personal memory agent
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

transfer: point --help and 401 at `sol observer create`

Ramon's install demo failed because `sol transfer send` was given a
journal-source API key, but the command actually requires an observer
API key from the RECEIVING host. The two key types are shape-
indistinguishable, so there is no reliable pre-flight detection path;
this is a pure discoverability fix.

Update the five transfer surfaces that need to teach the right command:
the module docstring, the send subparser description, the `--key` help,
and the two 401 auth failure messages. Keep the 403 wording unchanged,
preserve the `Authentication failed` prefix for existing tests, and use a
shared AUTH_INVALID_OBSERVER_KEY constant so both 401 surfaces stay
identical.

Co-Authored-By: OpenAI Codex <codex@openai.com>

+25 -4
+25 -4
observe/transfer.py
··· 10 10 sol transfer export --day YYYYMMDD [--output PATH] 11 11 sol transfer import --archive PATH [--dry-run] 12 12 sol transfer send --to HOST --key KEY [--day YYYYMMDD] [--dry-run] 13 + 14 + On the RECEIVING host (the machine you are sending TO), run 15 + `sol observer create <name>` to generate an observer API key, then pass it 16 + as `--key`. 13 17 """ 14 18 15 19 from __future__ import annotations ··· 40 44 ) 41 45 42 46 from .utils import compute_file_sha256, find_available_segment 47 + 48 + OBSERVER_KEY_HINT = ( 49 + "On the RECEIVING host (the machine you are sending TO), run " 50 + "`sol observer create <name>` to generate an observer API key, then " 51 + "pass it as `--key`." 52 + ) 53 + 54 + AUTH_INVALID_OBSERVER_KEY = ( 55 + "Authentication failed: invalid or missing observer API key. " + OBSERVER_KEY_HINT 56 + ) 43 57 44 58 logger = logging.getLogger(__name__) 45 59 ··· 438 452 if entry.get("key") 439 453 } 440 454 if response.status_code == 401: 441 - raise ValueError("Authentication failed: invalid or missing API key") 455 + raise ValueError(AUTH_INVALID_OBSERVER_KEY) 442 456 if response.status_code == 403: 443 457 raise ValueError("Authentication failed: observer revoked or disabled") 444 458 logger.warning( ··· 602 616 logger.info(f" [skip] {day}/{stream_name}/{seg_key}") 603 617 skipped += 1 604 618 elif status == "auth_invalid": 605 - print("Authentication failed: invalid or missing API key") 619 + print(AUTH_INVALID_OBSERVER_KEY) 606 620 return 607 621 elif status == "auth_revoked": 608 622 print("Authentication failed: observer revoked or disabled") ··· 671 685 ) 672 686 673 687 # Send subcommand 674 - send_parser = subparsers.add_parser("send", help="Send segments to remote observer") 688 + send_parser = subparsers.add_parser( 689 + "send", 690 + help="Send segments to remote observer", 691 + description=OBSERVER_KEY_HINT, 692 + ) 675 693 send_parser.add_argument( 676 694 "--to", 677 695 required=True, ··· 680 698 send_parser.add_argument( 681 699 "--key", 682 700 required=True, 683 - help="Observer API key for authentication", 701 + help=( 702 + "Observer API key (generate on the RECEIVING host with " 703 + "`sol observer create <name>`)" 704 + ), 684 705 ) 685 706 send_parser.add_argument( 686 707 "--day",