Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix(instances): accept null/void/NaN/undefined as valid hostnames, show all sync categories

Adam Eivy0f19ad917ced
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index cc0f13fff8..ddd9ed33c2 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -6,7 +6,9 @@
## Fixed
+- Instance names like "null", "void", "NaN", "undefined" are now accepted as valid hostnames
- Peer renames no longer revert when remote peer re-announces (handleAnnounce now preserves user-set names)
+- Self instance card now shows sync status for all categories (Goals, Character, Digital Twin, Meatspace), not just Brain and Memory
- CoS task evaluation now blocks tasks that exceeded max spawn limit before reaching spawn logic
- Metadata count fields (totalSpawnCount, failureCount, orphanRetryCount) use Number() coercion to prevent string comparison bugs
- jira-status-report task now runs in PortOS context (not the app's directory) and uses the correct PortOS API endpoint
diff --git a/client/src/pages/Instances.jsx b/client/src/pages/Instances.jsx
index 669d05ce4d..f8127f9150 100644
--- a/client/src/pages/Instances.jsx
+++ b/client/src/pages/Instances.jsx
@@ -134,13 +134,29 @@ function SelfCard({ self, onUpdate, syncStatus }) {
</div>
<p className="text-xs text-gray-500 font-mono">{self.instanceId}</p>
{syncStatus?.local && (
- <div className="mt-2 pt-2 border-t border-port-border/50 flex items-center gap-4 text-xs text-gray-400">
+ <div className="mt-2 pt-2 border-t border-port-border/50 grid grid-cols-2 gap-x-4 gap-y-1 text-xs text-gray-400">
<span className="flex items-center gap-1.5">
<Brain size={12} /> Brain seq: {syncStatus.local.brainSeq}
</span>
<span className="flex items-center gap-1.5">
<Database size={12} /> Memory seq: {syncStatus.local.memorySeq}
</span>
+ {SYNC_CATEGORY_META
+ .filter(m => m.key !== 'brain' && m.key !== 'memory')
+ .map(({ key, label, icon: Icon }) => {
+ const hasChecksum = !!syncStatus.local.checksums?.[key];
+ return (
+ <span key={key} className="flex items-center gap-1.5">
+ <Icon size={12} />
+ <span>{label}:</span>
+ {hasChecksum ? (
+ <CheckCircle2 size={11} className="text-port-success" />
+ ) : (
+ <Clock size={11} className="text-gray-600" />
+ )}
+ </span>
+ );
+ })}
</div>
)}
</div>
diff --git a/server/services/instances.js b/server/services/instances.js
index de4c314177..8f1df8d4dd 100644
--- a/server/services/instances.js
+++ b/server/services/instances.js
@@ -110,8 +110,7 @@ export async function getPeers() {
function validName(name, fallback) {
if (!name || typeof name !== 'string') return fallback;
- const lower = name.trim().toLowerCase();
- if (['undefined', 'nan', 'null', ''].includes(lower)) return fallback;
+ if (!name.trim()) return fallback;
return name.trim();
}
diff --git a/server/services/instances.test.js b/server/services/instances.test.js
index 3d182b68e2..5c19bdc1d5 100644
--- a/server/services/instances.test.js
+++ b/server/services/instances.test.js
@@ -205,13 +205,13 @@ describe('instances.js', () => {
expect(peer.name).toBe('10.0.0.3');
});
- it('should use address as name when name is invalid', async () => {
+ it('should accept names like null/undefined/NaN as valid hostnames', async () => {
readJSONFile.mockResolvedValue({ self: null, peers: [] });
fetch.mockRejectedValue(new Error('not reachable'));
const peer = await addPeer({ address: '10.0.0.4', name: 'null' });
- expect(peer.name).toBe('10.0.0.4');
+ expect(peer.name).toBe('null');
});
it('should use custom port when specified', async () => {
@@ -277,13 +277,13 @@ describe('instances.js', () => {
expect(result).toBeNull();
});
- it('should reject invalid name values and keep existing name', async () => {
+ it('should accept names like undefined as valid hostnames', async () => {
const peers = [{ id: 'peer-1', name: 'good-name', enabled: true }];
readJSONFile.mockResolvedValue({ self: null, peers });
const result = await updatePeer('peer-1', { name: 'undefined' });
- expect(result.name).toBe('good-name');
+ expect(result.name).toBe('undefined');
});
it('should not disconnect when enabling a peer', async () => {
@@ -601,7 +601,7 @@ describe('instances.js', () => {
expect(result.peer.directions).toContain('inbound');
});
- it('should not update name when announce name is invalid', async () => {
+ it('should preserve user-set name on announce even with NaN hostname', async () => {
const existing = {
id: 'p1',
address: '10.0.0.5',
@@ -620,6 +620,7 @@ describe('instances.js', () => {
name: 'NaN'
});
+ // Name preserved because 'good-name' is not an IP address
expect(result.peer.name).toBe('good-name');
});